Skip to content

Instantly share code, notes, and snippets.

View matthewwithanm's full-sized avatar

Matthew Dapena-Tretter matthewwithanm

View GitHub Profile
@matthewwithanm
matthewwithanm / django.wsgi
Created December 11, 2010 03:40
For use with django and mod_wsgi
import os, os.path
import sys
# Unless your project is already on your PYTHONPATH by default, you need to add it:
# project_directory should point to your project's parent directory.
project_directory = os.path.join(os.path.dirname(__file__), '..')
if project_directory not in sys.path:
sys.path.insert(0, project_directory)
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'