【发布时间】:2011-06-14 03:16:10
【问题描述】:
我正在尝试创建模块化设置文件。
为什么会这样:
project/
settings.py
other.py
在settings.py中使用这一行
config_module = __import__('other', globals(), locals())
虽然以下会引发 ImportError:
project/
settings.py
config/
other.py
在 settings.py 中有这一行:
config_module = __import__('config.other', globals(), locals())
【问题讨论】:
-
您在配置目录中是否缺少
__init__.py?
标签: python django django-settings