[Django]-App level settings in Django

4👍

Make a global settings.py, and specify which settings are needed in the apps documentation. You should not make app-specific settings.py files, unless they have some unrelated, internal use. You might want to use something like getattr(settings, 'SOME_SETTING_NAME', 'default value') to fetch the option with a default.

If you want to have separate settings for prod/staging/dev, then you’ll want to make a settings/ folder with an __init__.py file that imports based on an ENV variable.

Leave a comment