Avatar ·

How to make several configurations for the Django project?

📁 example, django, debug, project

It is quite obvious that, for example, on production and during development, the project configuration should be different. However, by default, Django provides for the use of a single settings.py, where everything is stored in one place, without any hints of separation. And I want to split it.

For example, during development, you can turn on DEBUG = True and connect Debug Toolbar, which you cannot do on production, use a specific local database for the developer, relax restrictions, etc.

In addition, if you want to publish a Django project on some GitHub, adding the settings.py with all the passwords to the repository is not cool at all. And if you remove the passwords from there, commit and then put the passwords back...