Created
December 11, 2010 03:40
-
-
Save matthewwithanm/737130 to your computer and use it in GitHub Desktop.
For use with django and mod_wsgi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
# 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