Thursday, 29 August 2013

Making Django work with Apache

Making Django work with Apache

I have a test django project that I have been using the django development
server for. I want to start using an actual apache server to properly
simulate a production environment. I am using Mac OS X.
I have been using this tutorial here, but in the first set of instructions
I am getting a 403 from localhost. The browser says I do not have
permission to access / on the server.
When I comment out the apache config line from the tutorial,
WSGIScriptAlias /
/Users/username/Projects/django_books/django_books/django.wsgi I can
access localhost.
This is the contents of my django.wsgi file:
import os import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'django_books.settings'
import django.core.handlers.wsgi application =
django.core.handlers.wsgi.WSGIHandler()
path = '/Users/username/Projects/django_books/django_books' if path not in
sys.path: sys.path.append(path)
What is causing the 403 and why can't I see my django application?

No comments:

Post a Comment