Python 从模块化django设置文件导入错误
我正在尝试创建一个模块化设置文件 为什么这样做有效:Python 从模块化django设置文件导入错误,python,django,django-settings,Python,Django,Django Settings,我正在尝试创建一个模块化设置文件 为什么这样做有效: project/ settings.py other.py 使用settings.py中的此行 config_module = __import__('other', globals(), locals()) 虽然以下情况引起了一种严重的恐惧: project/ settings.py config/ other.py 使用settings.py中的此行: config_module = __import__('
project/
settings.py
other.py
使用settings.py中的此行
config_module = __import__('other', globals(), locals())
虽然以下情况引起了一种严重的恐惧:
project/
settings.py
config/
other.py
使用settings.py中的此行:
config_module = __import__('config.other', globals(), locals())
看起来您的配置目录缺少一个
\uuuu init\uuuu.py
文件,以明确您希望将其视为一个模块。\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuupy
文件可以为空,但它必须存在。配置目录中是否缺少\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuupy
?