Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Django书第3章:“;没有名为mysite.wsgi的模块;_Python_Django - Fatal编程技术网

Python Django书第3章:“;没有名为mysite.wsgi的模块;

Python Django书第3章:“;没有名为mysite.wsgi的模块;,python,django,Python,Django,我一直在这个问题上纠缠了很久,而我发现的其他线索似乎都没有帮助 在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 'settin

我一直在这个问题上纠缠了很久,而我发现的其他线索似乎都没有帮助

在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
C:\Documents and Settings\ltiokhin\My Documents\DJCode\mysite>python manage.py runserver
正在验证模型。。。
发现0个错误
Django版本1.4.3,使用设置“设置”
开发服务器正在http上运行:___________________________
使用CTRL-BREAK退出服务器。
由启动的线程中存在未处理的异常
回溯(最近一次呼叫最后一次):
文件“C:\Python27\lib\site packages\django\core\management\commands\runserver。
py”,第109行,内螺纹
handler=self.get\u处理程序(*args,**选项)
文件“C:\Python27\lib\site packages\django\contrib\staticfiles\management\commands\runserver.py”,第24行,在get\u处理程序中
handler=super(命令,self).get\u handler(*args,**选项)
文件“C:\Python27\lib\site packages\django\core\management\commands\runserver.py”,第39行,在get\u处理程序中
返回get_internal_wsgi_application()
文件“C:\Python27\lib\site packages\django\core\servers\basehttp.py”,第58行,在get\u internal\u wsgi\u应用程序中
无法导入模块“%s”:%s“%(应用程序路径,模块名称,e))django.core.exceptions.impropertlyconfigured:无法加载WSGI应用程序“mysite.WSGI.appli阳离子”;无法导入模块“mysite.wsgi”:没有模块na med mysite.wsgi

提前谢谢你的帮助

您使用的版本与书中的版本相同吗? 上次我犯这种错误就是因为这个


或者您是否将wsgi添加到settings.py中已安装的应用程序中?

在文件夹“C:\Documents and settings\ltiokhin\My Documents\DJCode\mysite\mysite”下查找“wsgi.py”。可能是缺少标准django应用程序文件,或者将其命名为其他文件

我正在运行Django 1.4.3。在settings.py中,我将wsgi命名为“wsgi_APPLICATION='mysite.wsgi.APPLICATION'”,我一直认为这与您启动/配置项目的方式有关。尝试在下面创建一个新项目,如果成功运行第二个项目,请比较这些项目的设置中的不同之处。。。