Created
April 20, 2011 00:35
-
-
Save jordanorelli/930074 to your computer and use it in GitHub Desktop.
sample Django WSGI initialization script
This file contains hidden or 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 | |
import sys | |
# If your project is not on your PYTHONPATH by default you can add: | |
path = '/path/to/project' | |
if path not in sys.path: | |
sys.path.insert(0, path) | |
import settings | |
import django.core.management | |
django.core.management.setup_environ(settings) | |
utility = django.core.management.ManagementUtility() | |
command = utility.fetch_command('runserver') | |
command.validate() | |
import django.conf | |
import django.utils | |
django.utils.translation.activate(django.conf.settings.LANGUAGE_CODE) | |
import django.core.handlers.wsgi | |
application = django.core.handlers.wsgi.WSGIHandler() | |
import projectname.monitor | |
projectname.monitor.start(interval = 1.0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment