Hi.
This is probably a really trivial question.
How do I set my Django app's current working directory when
running
under mod_python?
I have a view which loads local files and includes their
content in a
directory. When running under the development server, this
works fine.
Running under mod_python, I get "[Errno 2] No such
file or directory: "
-- I assume that the project has a different working
directory when
running under mod_python.
I'm doing this in my view:
t = loader.get_template('showpage')
f = file('pages/%s' % path,"r")
body = f.read()
f.close()
I set the following options in my httpd conf:
<Location "/world">
SetHandler mod_python
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mymodule.settings_prod
PythonDebug On
PythonAutoReload Off
PythonPath "sys.path+['/srv/mymodule']"
</Location>
where mymodule is my project directory -- the directory
'pages', from
which I'm reading the files is beneath this directory and
is readable
by the Apache user.
Is there a setting I'm missing?
Thanks for your help,
Daniel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-users googlegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribe googlegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---
|