I was just trying to figure out how to configure django to work in a test production environment. I'm following both the tutorial on django doc on deployment and the mod_wsgi guide to django integration. No matter what i do, all i get is page not found (404 error), before if I comment out the modification to httpd.conf, it works fine and i get the test page, so the basics are correct.

Here are the relevant modifications i made: In the folder where manage.py and settings.py reside for the site, i made a folder called apache and inside that i created a file called django.wsgi. In the file is the following:

import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'faq.settings'

import django.core.handlers.wsgi
applicaion = django.core.handlers.wsgi.WSGIHandler()

jason/faq/faq is where manage.py and settings.py reside. In httpd.conf:

WSGIScriptAlias / /home/jason/faq/faq/apache/django.wsgi
<Directory /home/jason/faq/faq/apache>
Order deny, allow
Allow from all

Which is copied directly from the tutorial on mod_wsgi site.

If I run python manage.py runserver, it works fine for local host. I have no idea what could be wrong, if you need more information, please tell me where to get it, i am almost a complete newbie in regards to server administration tasks.

Thank you very much for all your help!


Well, it seems that i made a mistake in my spelling of 'application' in django.wsgi. I discovered the following error in /etc/log/apache2/error.log (for ubuntu) (i didn't figure out how to read the error log before):

[DATE] [error] [client IP] mod_wsgi (pid=15912): Target WSGI script '/home/jason/faq/faq/apache/django.wsgi' does not contain WSGI application 'application'.

After that is changed, everything is well. Then I tested to see about the permission thing, it appears that as long as i keep the apache/django.wsgi where apache can see it, it'll be fine (i change it to 777 for now).

| improve this answer | |
  • 3
    Using 777 is generally a very bad idea as it means any user on the system can write to the directories. – Graham Dumpleton Aug 20 '09 at 6:01

Does the user that Apache runs as have access to read directories/files out of your personal account? Have a read of:


In other words, a permissions problem.

| improve this answer | |
  • Well, i tried changing permissions on apache and apache/django.wsgi to 777. I also tried moving everything over to /usr/local/django and changing the permission there to 777 (also moving all of the references). It appears to not be doing anything. Perhaps there is a way of seeing what apache is doing? thanks a lot! – FurtiveFelon Aug 20 '09 at 1:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.