当我尝试运行一个项目时,它显示以下消息:
"C:\Program Files (x86)\JetBrains\PyCharm 3.4.1\bin\runnerw.exe" C:\Python27\python.exe G:/project/sample3/manage.py runserver 8000
Traceback (most recent call last):
File "G:/project/sample3/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\core\management\__init__.py", line 385, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\core\management\__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\core\management\__init__.py", line 238, in fetch_command
klass = load_command_class(app_name, subcommand)
File "C:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\core\management\__init__.py", line 41, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
__import__(name)
File "C:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\contrib\staticfiles\management\commands\runserver.py", line 18
def get_handler(self, *args, use_static_handler=True, insecure_serving=False, **options):
^
SyntaxError: invalid syntax
Process finished with exit code 1
这发生在所有项目上。这个问题始于意外...
看起来您可能不小心修改了安装中的Django代码,因为这不是实际Django源代码中该文件的第18行。请尝试卸载并重新安装Django。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句