Also note that your code should not import from either
global_settings or your own settings file. django.conf.settings
abstracts the concepts of default settings and site-specific settings;
it presents a single interface. It also decouples the code that uses
settings from the location of your settings.
您的模块应该以标准方式访问django设置:
从https://docs.djangoproject.com/en/1.8/topics/settings/#using-settings-in-python-code
如果模块有自己的设置,可以在项目的设置.py. 您可以在模块中硬编码合理的默认值,如果需要设置.py价值观。你知道吗
相关问题 更多 >
编程相关推荐