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 t开发者_开发问答he one provided by ubuntu?
Create a virtualenv for your django (with --no-site-packages) and activate it. Then install everything you need inside it.
No, simply make sure that the one you want to use shows up in an earlier directory in sys.path
.
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/
精彩评论