[mod_python] Help with Apache and mod_python

Paolo paolophp3 at gmail.com
Sat Dec 3 06:19:49 EST 2005


2005/12/3, Graham Dumpleton <grahamd at dscpl.com.au>:
>
>
> Next step then would be to import into the handler of your test code,
> the module which you specify needs to be imported in order to make
> use of Django.


Now mptest.py looks like:
from mod_python import apache

def handler(req):
    import django.core.handlers.modpython
    req.content_type = 'text/plain'
    req.write('mptest.py\n')
    return apache.OK


> If done in the test handler function, accessing the
> test URL will cause it to be imported and if it does crash at that point
> you have confirmed that it is the actual import of the Django stuff that
> is the problem.


It seems that django.core.handlers.modpython is imported very well, as in
error_log I can't see signs of crash and 'mptest.py' is still printed.

I have something new to say.
This morning I created a Django project (called erp) to be used as a test.
Then I have configured Apache with the same lines in httpd.conf used for the
other project (called cardano), discovering that erp project is served fine
by Apache, while cardano project crashes Apache.

These are the lines of httpd.conf that have been added:

# test project - it works
<VirtualHost 192.168.0.68:85>
DocumentRoot "/home/paolo/projects/django"
<Location "/">
    SetHandler mod_python
    PythonHandler django.core.handlers.modpython
    PythonPath "['/home/paolo/projects/django']+sys.path"
    SetEnv DJANGO_SETTINGS_MODULE erp.settings
    PythonDebug On
    PythonInterpreter erp
</Location>
</VirtualHost>

# the other project - it doesn't work
<VirtualHost 192.168.0.68:86>
DocumentRoot "/home/paolo/projects/django"
<Location "/">
    SetHandler mod_python
    PythonHandler django.core.handlers.modpython
    PythonPath "['/home/paolo/projects/django']+sys.path"
    SetEnv DJANGO_SETTINGS_MODULE cardano.settings
    PythonDebug On
    PythonInterpreter cardano
</Location>
</VirtualHost>

I hope these new indications can help, thanks very much for your support.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20051203/f041b605/attachment.html


More information about the Mod_python mailing list