首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >django -用于cherrypy和django的wsgiserver

django -用于cherrypy和django的wsgiserver
EN

Stack Overflow用户
提问于 2013-10-06 23:26:54
回答 1查看 718关注 0票数 0

我下载并安装了django-wsgiserver应用程序,这样我就可以在我的django项目中使用cherrypy了。我使用pip安装它,并将其添加到我的settings.py中。我在manage.py上看到runwsgiserver命令。但是当我尝试运行它时,我得到了以下错误

代码语言:javascript
复制
./manage.py runwsgiserver
KeyError: 'default'

故障可能是什么?你还需要更多的信息吗?

代码语言:javascript
复制
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,现在我得到了这条消息

代码语言:javascript
复制
./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

为什么会这样呢?

EN

回答 1

Stack Overflow用户

发布于 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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19210465

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档