forked from agiliq/so-starving
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a module to expose a WSGI app called application
- Loading branch information
1 parent
1434f6c
commit 0bd9b4d
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |