I seem to have similar problem as this guy: Django newbie deployment question - ImportError: Could not import settings 'settings' but i cant make heads or tails of it. The server is running Debian. The app runs fine on internal server, however when trying to use apache + mod_python i get the following problem.
File "/usr/local/lib/python2.6/dist-packages/django/conf/__init__.py", line 89, in __init__
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'treeio.settings' (Is it on sys.path?): No module named treeio.settings
- Project directory is /var/www/treeio
- All files have file permission 777 (i was testing if there were any permission problems)
Content of httpd.conf
<Location "/treeio/"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE treeio.settings PythonOption django.root /treeio PythonDebug On PythonPath "['/var/www/treeio'] + sys.path" </Location>
More info:
echo $PYTHONPATH
:/var/www/treeio/..:/var/www/treeio
echo $DJANGO_SETTINGS_MODULE
treeio.settings
>>> import sys
>>> sys.path
['', '/usr/local/lib/python2.6/dist-packages/pip-1.0.2-py2.6.egg', '/var/www/treeio', '/var/www', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/local/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages', '/usr/lib/pymodules/python2.6']
Help me stackoverflow, you're my only hope!