附录
python -m django --version
You should always use `include()` when you include other URL patterns. `admin.site.urls` is the only exception to this.
-
-
settings.py
-
If you set DEBUG to False, you also need to properly set the ALLOWED_HOSTSsetting.
-
修改配置文件名称需要同步修改wsgi中的DJANGO_SETTINGS_MODULE
-
-
Default settings
-
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:
-
Load settings from
global_settings.py
. -
Load settings from the specified settings file, overriding the global settings as necessary.
-
-
Note that a settings file should not import from
global_settings
-