Skip to content

Instantly share code, notes, and snippets.

@lettertwo
Forked from matthewwithanm/django.wsgi
Created December 13, 2010 19:19
Show Gist options
  • Save lettertwo/739437 to your computer and use it in GitHub Desktop.
Save lettertwo/739437 to your computer and use it in GitHub Desktop.
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.append(project_directory);
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
# Create the wsgi application.
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
# Run the monitor
import settings
if settings.DEBUG:
try:
import monitor
monitor.start(interval=1.0)
except:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment