Skip to content

Commit

Permalink
Added the wsgi loader for uWSGI
Browse files Browse the repository at this point in the history
  • Loading branch information
armon committed Jun 8, 2011
1 parent 5f42dc0 commit 7a87eb4
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions wsgi.py
@@ -0,0 +1,29 @@
#!/usr/bin/python
import sys
import site
import os
import os.path

# Get the base dir
base_dir = os.path.dirname(os.path.abspath(__file__))

# Fix for dev mode
if base_dir == "/project":
base_dir = "/server/env.example.com/project/"

# Get the site dir
site_dir = os.path.join(base_dir,"../lib/python2.6/site-packages")
site.addsitedir(site_dir)

# Adjust the system path
sys.path.append(os.path.join(base_dir,"project/"))
sys.path.append(os.path.join(base_dir, "project/core/"))

# Setup the settings module
os.environ['DJANGO_SETTINGS_MODULE'] = "settings"
os.environ["CELERY_LOADER"] = "django"

# Load django
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()

0 comments on commit 7a87eb4

Please sign in to comment.