Not sure if this is the right place to ask this question, but I'm migrating a django project from mod_python to mod_wsgi and I want to make sure I have my apache configuration correct. The old configuration looks like this:
DocumentRoot /srv/www/PROJECT/
<location "/">
Options +FollowSymLinks
allow from all
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE PROJECT.settings
PythonPath "['/srv/www/PROJECT'] + sys.path"
PythonDebug On
PythonInterpreter PROJECT
</location>
<location "/site_media/">
Options +FollowSymLinks
SetHandler None
</location>
<location "/admin_media/">
Options +FollowSymLinks
SetHandler None
</location>
<Location "/server-status">
SetHandler server-status
Allow from .test.org localhost 127.0.0.1
</Location>
Reading the documentation, it seems like all I have to do is:
WSGIDaemonProcess PROJECT processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup PROJECT
WSGIScriptAlias /PROJECT /srv/www/django.wsgi
<Directory /srv/www/PROJECT/ >
Order allow,deny
Allow from all
</Directory>
Alias /site_media "/srv/www/site_media/"
Alias /admin_media "/srv/www/admin_media/"
With django.wsgi containing:
import os,sys
sys.path.append('/srv/www/PROJECT')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Do these look like the appropriate changes? I am not too familiar with mod_python (I didn't set this site up- it's just my job now to migrate it :( ) so I'm not sure on the conversion. Any other advice would be much appreciated.
0 Answers