我刚刚升级到Django 1.5,当我尝试访问页面时,出现以下错误:
ImproperlyConfigured: Error importing middleware app.middleware: "cannot import name get_host"
Run Code Online (Sandbox Code Playgroud)
在shell中,我尝试了类似的事情:
>>> from app import middleware
Traceback (most recent call last):
File "<console>", line 1, in <module>
File ".../middleware.py", line 2, in <module>
from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect, get_host
ImportError: cannot import name get_host
Run Code Online (Sandbox Code Playgroud)
它的导入失败了get_host
.它似乎不被弃用,发生了什么?