H5W3
当前位置:H5W3 > 其他技术问题 > 正文

digitalocean部署django出现错误Traceback (most recent call last)

Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 187, in __call__
    self.load_middleware()
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 45, in load_middleware
    mw_class = import_by_path(middleware_path)
  File "/usr/lib/python2.7/dist-packages/django/utils/module_loading.py", line 31, in import_by_path
    error_prefix, module_path, class_name))
ImproperlyConfigured: Module "django.contrib.auth.middleware" does not define a "SessionAuthenticationMiddleware" attribute/class

用的环境是digitalocean里面初始化application里面有个django的初始环境,Ubuntu14.0X


···回复:

这个类是 django 1.7新加的,你的 django 版本太老了

如何查看django版本?打开python执行下面的代码

import django
django.VERSION

本文地址:H5W3 » digitalocean部署django出现错误Traceback (most recent call last)