Creating a Django Boilerplate!(part 2)

Shrey Modi
2 min readOct 2, 2020

Part 2(Setting up multiple settings modules)

So mainly in this part we will focus on making different settings module like development and production.

Make a folder named settings and add a file called __init__.py in it.Then move the settings.py in the folder and rename it as base.py.

Make two new files named development.py and production.py.

In development file we will include the settings required for the development like the app or function name in INSTALLED_APPS, added functions in MIDDLEWARE , DATABASE and the entire debug toolbar setting.

while the production file will include AUTH_PASSWORD_VALIDATORS, DATABASES(sqllite or postgres or any other) and the stripe keys if payment is integrated in it. After adding all these just delete the the added items from the main file i.e base.py

so now the runserver command would get confuse which setting to take so for that we need to make some change in the manage.py file in the line 8 as below:

And also change the BASE_DIR settings as follow:

The folder structure will be as following:

folder structure

--

--