How to use Django-1.5 via parallel installable python-django15

Last week, the package python-django15 was approved. It’s a Django package to be installed in parallel to e.g python-django. Once you installed it, you can not use it directly. For example for python-django-horizon aka. OpenStack Dashboard we need to change the django.wsgi from github to

import logging
import os
import sys

# explicitly require Django 1.5 or later
from pkg_resources import require

import django.core.handlers.wsgi
from django.conf import settings

# Add this file path to sys.path in order to import settings
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '../..'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_dashboard.settings'
sys.stdout = sys.stderr

DEBUG = False

application = django.core.handlers.wsgi.WSGIHandler()

Note the two lines enclosed in the lines of hash signs. That’s all you need to use Django-1.5 from python-django15 and have Django-1.6 installed in parallel.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s