LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Integrating Django Into Apache (http://www.linuxquestions.org/questions/linux-server-73/integrating-django-into-apache-819109/)

cmnorton 07-10-2010 02:07 PM

Integrating Django Into Apache
 
I'm working through Django examples in the Django Visual Quickpro Guide. Those are working out nicely, but I am having trouble integrating this into my Apache server.

Does any one have samples as to how to do this?

The thing that perplexes me the most is the admin site formats nicely using the built-in web server, but displays flat accessing in Apache.

Here's my current apache2.conf config corresponding to the django application:

Listen 8586
<VirtualHost _default_:8586>

<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE chapter4.settings
PythonOption django.root /home/amr/web/django/chapter4
PythonPath "['/home/amr/web/django/'] + ['/home/amr/web/django/favorites/'] + sys.path"
PythonDebug On
</Location>
</VirtualHost>

cmnorton 09-24-2010 01:59 PM

Working Apache Configuration
 
This works in Apache and for mod_python
Code:

<Location />
        SetHandler python-program
        PythonHandler django.core.handlers.modpython
        SetEnv DJANGO_SETTINGS_MODULE settings
        PythonOption django.root /home/amr/django/amr
        PythonPath "['/home/amr/django', '/home/amr/django/amr', '/usr/local/lib
/site-packages/django'] + sys.path"
        PythonDebug On
</Location>



All times are GMT -5. The time now is 04:16 AM.