Python django path

How can I add something to my "Pythonpath".

Where exactly are the files I should change to add to my pythonpath?

What exactly am I adding to my Pythonpath?

If Python calls:

/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/

But I want him to call

/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages

What I need to add to make it work.

The strange thing is that I already used django-admin.py for the startproject c command. But now he does not find him.

Is there a way to clear my ALL of my Python, Django, to restart it with the new version?

+6
python django path
source share
2 answers
>>> import sys >>> sys.path 

sys.path is a list of search paths for modules.

if you want the module to be loaded from /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages instead of /Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/

you just need to make sure the site-packages search path is before the Contents in sys.path

you can set python path using PYTHONPATH environment variable

ex: (on linux system)

 export PYTHONPATH=/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages:$PYTHONPATH 
+4
source share

This tutorial will probably work for you if you want to uninstall the old version: http://docs.djangoproject.com/en/1.2/topics/install/#removing-old-versions-of-django

-one
source share

All Articles