Bunny Rabbit
Bunny Rabbit

Reputation: 8411

How do you specify which django version to use?

I am using ubuntu and I have installed django from the Ubuntu Software Center. For some projects I want to use the django cloned from the trunk instead of the default one. How can i do that ? Do I need to unistall the one provided by ubuntu?

Upvotes: 0

Views: 405

Answers (3)

John Mee
John Mee

Reputation: 52323

if wsgi in use then set the path to the desired django installation in the django.wsgi file. eg

import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
sys.path[:0] = ['/path/to/django/version/','/path/to/project/']
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

If modpython then set the path in the apache configuration file

PythonPath "['/path/to/django/version','/path/to/project'] + sys.path"

The docs might help: http://docs.djangoproject.com/en/dev/howto/deployment/modpython/

Upvotes: 0

Marco Mariani
Marco Mariani

Reputation: 13776

Create a virtualenv for your django (with --no-site-packages) and activate it. Then install everything you need inside it.

Upvotes: 3

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799240

No, simply make sure that the one you want to use shows up in an earlier directory in sys.path.

Upvotes: 1

Related Questions