Skip to content

Commit

Permalink
Created a module to expose a WSGI app called application
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmoritz committed Nov 8, 2010
1 parent 1434f6c commit 0bd9b4d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions django/app.py
@@ -0,0 +1,19 @@
import site
import os

# Django is such a pain to get to work within WSGI
here = os.path.dirname(os.path.abspath(__file__))
there = os.path.join(here, "fml")
site.addsitedir(here)
site.addsitedir(there)
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

from django.core.handlers.wsgi import WSGIHandler

application = WSGIHandler()

if __name__ == '__main__':
from wsgiref.simple_server import make_server
httpd = make_server('', 9002, application)
print "Serving on port 8080..."
httpd.serve_forever()

0 comments on commit 0bd9b4d

Please sign in to comment.