Python 如何配置wsgi应用程序以迁移到django 1.7?
我正在尝试从Django 1.6升级到1.7 运行python manage.py runserver时,出现以下错误:Python 如何配置wsgi应用程序以迁移到django 1.7?,python,django,wsgi,Python,Django,Wsgi,我正在尝试从Django 1.6升级到1.7 运行python manage.py runserver时,出现以下错误: django.core.exceptions.ImproperlyConfigured: WSGI application 'myapp.wsgi.application' could not be loaded; Error importing module: 'cannot import name get_path_info' 下面是my settings.py中的对应
django.core.exceptions.ImproperlyConfigured: WSGI application 'myapp.wsgi.application' could not be loaded; Error importing module: 'cannot import name get_path_info'
下面是my settings.py中的对应行:
WSGI_APPLICATION = 'myapp.wsgi.application'
这是我的wsgi.py文件:
import os
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "myapp.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myapp.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
from dj_static import Cling
application = Cling(get_wsgi_application())
有没有办法解决这个问题?你使用的是什么版本的dj_static 我升级到Django 1.7,我的网站坏了,这就引出了你的问题 我检查了我的dj_静态版本(我一直在使用0.0.5,并注意到撰写本文时的最新版本是)
更新dj_static后,我的站点在Django 1.7下似乎运行正常。看起来是
Cling
导致了错误。你能删除Cling
&再试一次吗?@chillara如果我这样做,服务器会启动,但静态文件不再提供。你是怎么想的?