生菜和Django 1.55+获得ImportError:无法导入名称WSGIServerException

时间:2013-11-13 23:58:19

标签: django lettuce

尝试将Lettuce整合到我的django安装中并收到以下错误:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/var/www/abc/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/var/www/abc/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/var/www/abc/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 272, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/var/www/abc/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 75, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/var/www/abc/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/var/www/abc/local/lib/python2.7/site-packages/lettuce/django/__init__.py", line 19, in <module>
    from lettuce.django.server import Server
  File "/var/www/abc/local/lib/python2.7/site-packages/lettuce/django/server.py", line 33, in <module>
    from django.core.servers.basehttp import WSGIServerException
ImportError: cannot import name WSGIServerException

我听说django已经删除了WSGIServerException,所以我该如何解决这个问题呢?

2 个答案:

答案 0 :(得分:3)

它是fixed on branch master,但PyPI尚未提供。

您只需从源代码安装即可:

pip install -e git+https://github.com/gabrielfalcao/lettuce.git#egg=lettuce

答案 1 :(得分:2)

doc

  

未记录的django.core.servers.basehttp.WSGIServerException具有   被删除了。使用标准库提供的socket.error   代替。

我想你可以告诉“生菜”的作者,0.0。或者:更新“生菜”python包。