Hi Robert,

The "old" version breaks because it's now missing a key part of the Django
startup sequence:

import django
django.setup()

This is something that was added in 1.7 as part of the app loading changes.

So, to answer your questions directly:

1) You either need to use get_wsgi_application(), or you need to do the
call to django.setup() yourself.

2/3) It's kinda documented...

https://docs.djangoproject.com/en/1.7/releases/1.7/#app-loading-changes

... although from that it might not be obvious that this impacts the wsgi
script as well. That sounds like it would be a worthwhile addition to the
docs.

Yours,
Russ %-)

On Fri, Sep 5, 2014 at 12:14 AM, Robert Grant <[email protected]>
wrote:

> I was using
>
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
> as per whichever *This Is The Right Way To Lay Out A Django Application*
> article I was reading at the time. This seems to now break in 1.7 (details
> - from someone else - here <https://code.djangoproject.com/ticket/23146>),
> so I've replaced it with
>
> from django.core.wsgi import get_wsgi_application
> from dj_static import Cling
>
> application = Cling(get_wsgi_application())
>
> Which seems to work, although I don't know why.
>
> So:
> 1) Is this a universal thing everyone should do?
> 2) If everyone is going to hit this same issue, can we add it to the
> migration docs?
> 3) If it's already in the migration docs, apologies :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/4a301792-988c-49a2-a86d-f08b20aee132%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/4a301792-988c-49a2-a86d-f08b20aee132%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAJxq8495dWbGQUyKZBqeW8g3powwj%3DAcAiKZE-bhD1xdLXtMVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to