How do I set up a wsgi app to migrate to django 1.7?

I am trying to migrate from Django 1.6 to 1.7.

I got the following error when running python manage.py runningerver:

django.core.exceptions.ImproperlyConfigured: WSGI application 'myapp.wsgi.application' could not be loaded; Error importing module: 'cannot import name get_path_info'

      

Here's the relevant line in my settings.py:

WSGI_APPLICATION = 'myapp.wsgi.application'

      

Here is my wsgi.py file:

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 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())

      

Any idea to fix this?

+3


source to share


1 answer


Which version of dj_static are you using?

I upgraded to Django 1.7 and my site crashed which led me to your question.



I checked my dj_static version (I used 0.0.5 and noticed the latest version at the time of this writing is 0.0.6 ).

After updating dj_static, my site seems to be working correctly in Django 1.7.

+3


source







All Articles