我下载并安装了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',
)
编辑:我解决了......不得不添加数据库引擎:P ..但现在我收到了这条消息
./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
为什么会这样?
答案 0 :(得分:0)
是的,如果您遇到问题,请在运行之前./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