我下载并安装了django-wsgiserver应用程序,这样我就可以在我的django项目中使用cherrypy了。我使用pip安装它,并将其添加到我的settings.py中。我在manage.py上看到runwsgiserver命令。但是当我尝试运行它时,我得到了以下错误
./manage.py runwsgiserver
KeyError: 'default'故障可能是什么?你还需要更多的信息吗?
setting.py
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_wsgiserver',
'south',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)编辑:我解决了it...had来添加db引擎:P..But,现在我得到了这条消息
./manage.py runwsgiserver host=0.0.0.0 staticserve=False
Validating models..
0 errors found
October 06, 2013 - 11:02:37
Django version 1.5.4, using settings 'rhombus.settings'
cherrypy django_wsgiserver is running at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
Unhandled exception in thread started by <bound method Command.start_server_servestatic of <django_wsgiserver.management.commands.runwsgiserver.Command object at 0x9f6c70c>>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django_wsgiserver/management/commands/runwsgiserver.py", line 469, in start_server_servestatic
server.start()
File "/usr/local/lib/python2.7/dist-packages/django_wsgiserver/wsgiserver/wsgiserver2.py", line 1857, in start
raise socket.error(msg)
socket.error: No socket could be created为什么会这样呢?
发布于 2013-10-12 08:53:48
是的,如果您有问题,在运行./manage.py runwsgiserver之前,请确保django项目中的其他一切工作正常。例如,do::
./manage.py syncdb./manage.py runserver #使用内置服务器测试项目
如果另一个进程正在运行,而该进程已经使用了端口8000,则可能会发生您看到的特定套接字错误。
另外,我可以看到您使用的是django 1.5.4。提到其他应用程序的哪些版本以及您运行在哪种操作系统上总是很有帮助的: linux?,mac?,windows?django-wsgiserver 0.8.0rc?
我希望现在一切都对你有效。
-CLM
https://stackoverflow.com/questions/19210465
复制相似问题