我曾经写过一篇Django应用程序,名为superlists
,和设置在superlists.settings
。 这对教程,我正在改变不同的充设置,一点没想到我在做什么。 而现在,当我开始新的Django项目-它告诉我它无法导入superlists.settings
我重新安装了Pycharm,Django的,蟒蛇(两个版本2.7和3.3),删除所有虚拟ENVS,删除可能被连接到它的一切好几次......它仍然存在! 在一个新的,干净的Python版本,甚至不具有Django的-有DJANGO_SETTINGS_MODULE
在sys.path
指向superlists.settings
。 在一个干净的每一个新项目,使用默认设置,pycharm的版本,告诉我,它无法导入superlists.settings
。
我删除DJANGO_SETTINGS_MODULE
从定点到设置sys.path
从CMD -然后退出再次观看-它的存在。
当它需要它? 我不知道。 这里是回溯:
Traceback (most recent call last):
File "D:/Python27/Lib/site-packages/django/bin/django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "D:\Python27\Lib\site-packages\django\core\management\__init__.py", line 399, in execute_from_command_line
utility.execute()
File "D:\Python27\Lib\site-packages\django\core\management\__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "D:\Python27\Lib\site-packages\django\core\management\__init__.py", line 261, in fetch_command
commands = get_commands()
File "D:\Python27\Lib\site-packages\django\core\management\__init__.py", line 107, in get_commands
apps = settings.INSTALLED_APPS
File "D:\Python27\Lib\site-packages\django\conf\__init__.py", line 54, in __getattr__
self._setup(name)
File "D:\Python27\Lib\site-packages\django\conf\__init__.py", line 49, in _setup
self._wrapped = Settings(settings_module)
File "D:\Python27\Lib\site-packages\django\conf\__init__.py", line 132, in __init__
% (self.SETTINGS_MODULE, e)
ImportError: Could not import settings 'superlists\settings.py' (Is it on sys.path? Is there an import error in the settings file?): Import by filename is not supported.