我错误地导出了一些设置,例如: 导出DJANGO_SETTINGS_MODULE = example.settings
现在当我尝试使用django-admin.py时,它给了我错误:
Traceback (most recent call last):
File "/usr/bin/django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 261, in fetch_command
commands = get_commands()
File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 107, in get_commands
apps = settings.INSTALLED_APPS
File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 54, in __getattr__
self._setup(name)
File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 49, in _setup
self._wrapped = Settings(settings_module)
File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 132, in __init__
% (self.SETTINGS_MODULE, e)
ImportError: Could not import settings 'example.settings.base' (Is it on sys.path? Is there an import error in the settings file?): No module named example.settings.base
我发现了名为flush的命令,但django-admin被阻止,我不知道该怎么做,可能我需要找到sys.path文件。
提前致谢!