django and mod_python

B

bapolis

Hi,

I read the mod_python documentation on the Django site but I'm getting
this error:

EnvironmentError: Could not import DJANGO_SETTINGS_MODULE
'accesshiphop.settings' (is it on sys.path?): No module named
accesshiphop.settings

Here's my httpd.conf:

<Location "/public_html/myproject/">
PythonPath "[r'c:/apache/public_html/myproject/']+sys.path"
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE myproject.settings
PythonDebug On
</Location>

Also, the Django site says "Also, if you've manually altered your
PYTHONPATH to put your Django project on it, you'll need to tell
mod_python:"

I don't recall adding my project to my PYTHONPATH. Should I have done
this? How do I do this?

Thanks.
 
R

Robin Becker

Hi,

I read the mod_python documentation on the Django site but I'm getting
this error:

EnvironmentError: Could not import DJANGO_SETTINGS_MODULE
'accesshiphop.settings' (is it on sys.path?): No module named
accesshiphop.settings

Here's my httpd.conf:

<Location "/public_html/myproject/">
PythonPath "[r'c:/apache/public_html/myproject/']+sys.path"
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE myproject.settings
PythonDebug On
</Location>

Also, the Django site says "Also, if you've manually altered your
PYTHONPATH to put your Django project on it, you'll need to tell
mod_python:"
......
in my setup the PythonPath statement puts the folder containing
myproject onto the PythonPath in your case that might be

PythonPath "[r'c:/apache/public_html']+sys.path"

also I place the SetEnv DJANGO_SETTINGS_MODULE .....
before specifying the PythonHandler, but I am unsure if that is required
(I guess it depends on exactly how apache sets up the location), but
it's what I would do in a batch file for example.
 
B

Bruno Desthuilliers

(e-mail address removed) a écrit :
Hi,

I read the mod_python documentation on the Django site but I'm getting
this error:

EnvironmentError: Could not import DJANGO_SETTINGS_MODULE
'accesshiphop.settings' (is it on sys.path?): No module named
accesshiphop.settings

Here's my httpd.conf:

(snip - already answered)

<OT>
BTW, there's a django mailing-list, and IIRC a mod_python mailing-list
too. When possible, post to the most specific(s) list(s).
</OT>
 
L

Laurent Rahuel

Bruno said:
(e-mail address removed) a écrit :

(snip - already answered)

<OT>
BTW, there's a django mailing-list, and IIRC a mod_python mailing-list
too. When possible, post to the most specific(s) list(s).
</OT>

Hi,

There are also some wxpython, pyqt, ... mailing-list, iircc and you don't
seem to bother requesters with not being at the right place ;-)

Regards,

Laurent.
 
B

bruno at modulix

Laurent said:
Bruno Desthuilliers wrote:




Hi,

There are also some wxpython, pyqt, ... mailing-list, iircc and you don't
seem to bother requesters with not being at the right place ;-)

Laurent,

I'm not here to bother anyone. The point here is that the OP's question
is more about django/mod_python conf than about Python itself, so I
*advise* him to post on one of these lists.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top