Created
January 30, 2012 13:10
-
-
Save gabamnml/1704316 to your computer and use it in GitHub Desktop.
Django with Tornado
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
#! /usr/bin/env python | |
import os | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.wsgi | |
import sys | |
import django.core.handlers.wsgi | |
sys.path.append('/your/project/path/') | |
def main(): | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' | |
application = django.core.handlers.wsgi.WSGIHandler() | |
container = tornado.wsgi.WSGIContainer(application) | |
http_server = tornado.httpserver.HTTPServer(container) | |
http_server.listen(8000) | |
tornado.ioloop.IOLoop.instance().start() | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment