Your Django settings file contains all the configuration of your Django installation. This appendix explains how settings work and which settings are available.
A settings file is just a Python module with module-level variables. Here are a couple of example settings:
ALLOWED_HOSTS = ['www.example.com'] DEBUG = False DEFAULT_FROM_EMAIL = '[email protected]'
Because a settings file is a Python module, the following apply:
MY_SETTING = [str(i) for i in range(30)]
A Django settings file doesn't have to define any settings if it doesn't need to. Each setting has a sensible default value. These defaults live in the module django/conf/global_settings.py
. Here's the algorithm Django uses in compiling settings:
global_settings.py
Note that a settings file should not import from global_settings
, because that's redundant.