我一直坚持这个问题看似永远,而我发现的其他线程似乎都没有帮助。
当我在cmd中运行python manage.py runserver时,我得到了这个输出:
C:\Documents and Settings\ltiokhin\My Documents\DJCode\mysite>python manage.py runserver
Validating models...
0 errors found
Django version 1.4.3, using settings 'settings'
Development server is running at http:___________________________
Quit the server with CTRL-BREAK.
Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x010689 F0>>
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.
py", line 109, in inner_run
handler = self.get_handler(*args, **options)
File "C:\Python27\lib\site-packages\django\contrib\staticfiles\management\commands\runserver.py", line 24, in get_handler
handler = super(Command, self).get_handler(*args, **options)
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 39, in get_handler
return get_internal_wsgi_application()
File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py", line 58, in get_internal_wsgi_application
"could not import module '%s': %s" % (app_path, module_name, e)) django.core.exceptions.ImproperlyConfigured: WSGI application 'mysite.wsgi.appli cation' could not be loaded; could not import module 'mysite.wsgi': No module na med mysite.wsgi
提前感谢您的帮助。
答案 0 :(得分:0)
您使用的是与书中相同的版本吗? 上次我遇到这种错误是因为那个!
或者您是否将wsgi添加到了settings.py?
中的installed_apps答案 1 :(得分:0)
在“C:\ Documents and Settings \ ltiokhin \ My Documents \ DJCode \ mysite \ mysite”文件夹下查找“wsgi.py”。可能是标准的django应用程序文件丢失或其命名为其他内容。