You are not logged in.

#1 2011-02-14 14:50:06

jzacsh
Member
Registered: 2010-11-07
Posts: 3

envvar: PYTHONPATH - config issue with python2.7 and django framework

Hello,

I've got these env. vars:
export PYTHONHOME=/usr/lib/python2.7
export PYTHONDOCS=/usr/share/doc/python/html/
export PYTHONPATH=$HOME/bin/lib/python
export PYTHONVER=3
export PYTHONSTARTUP=$HOME/.pythonrc.py

I'm new to python and django, so I'm guessing the issue is probably with my config somewhere along the line.

I've got a directory (python module) where I'm writing a django app:
/srv/http/subs/dj/inc/appname

According to the django docs[1] and the python documentation[2], I have to set PYTHONPATH so that python will know where to import my (above) module from. So the following is what I changed to match this:
export PYTHONHOME=/usr/lib/python2.7
export PYTHONPATH=$HOME/bin/lib/python:/srv/http/subs/dj/inc/appname
export PYTHONVER=2.7

So to test out that the above ^ makes my module available to python, I wanted to run `import mymodule.settings` in the python interpreter, but `env | grep PYTHON` reveals my machine is slapping /usr/lib/python3.1/ onto the end of PYTHONPATH. I'm hoping this is why my interpreter crashes with this: http://dpaste.de/99OV/raw/. Could anyone suggest how to change what is getting tacked onto the end of PYTHONPATH?

refs:
In the django docs you can see the output of `runserver`[1] shows the module path of the app being written, eg.: "Django version 1.0, using settings 'mysite.settings'".
[1] http://docs.djangoproject.com/en/1.2/in … ent-server
In the python docs, PYTHONHOME should contain your 'prefix/lib/python_version' (or in our case: /usr/lib/python2.7/).
[2] http://docs.python.org/using/cmdline.ht … PYTHONHOME

Offline

Board footer

Powered by FluxBB