Update WSGI app creation to be compatible with Django 1.7 or greater

This resolves the following error when trying to run Horizon if it has
been installed via "django-admin make_web_conf --wgi":

AppRegistryNotReady: The translation infrastructure cannot be
initialized before the apps registry is ready. Check that you don't
make non-lazy gettext calls at import time.

and is backwards-compatible with our currently supported versions.

Closes-Bug: #1497986
Change-Id: I643058bb82f8e0f11b38ce0dd046773e91e053c3
This commit is contained in:
Yves-Gwenael Bourhis 2015-09-21 15:13:06 +02:00
parent 079a47a5cd
commit f9e864c9fc

View File

@ -9,5 +9,5 @@ execfile(activate_this, dict(__file__=activate_this))
sys.path.insert(0, '{{ PROJECT_ROOT }}')
os.environ['DJANGO_SETTINGS_MODULE'] = '{{ DJANGO_SETTINGS_MODULE }}'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
import django.core.wsgi
application = django.core.wsgi.get_wsgi_application()