Note that there are some explanatory texts on larger screens.

plurals
  1. POTwisted + Django + Reverse Proxy
    text
    copied!<p>I am deploying twisted as a web server for my site. I am looking into possibilities of reverse proxying. </p> <p>I have the following code right now hooked up to my reactor for django. I am using comet, and I realize that I absolutely must use port 80 hence I am looking into possibilities of reverse proxying. On this site, I found the following example:</p> <pre><code># Django setup sys.path.append("shoout_web") os.environ['DJANGO_SETTINGS_MODULE'] = 'shoout_web.settings' def wrapper_WSGIRootWrapper(): # Build the wrapper first generic = WSGIHandler() def HandlerWrapper(environ, start_response): environ['engine'] = engine return generic(environ, start_response) # Thread and Allowing Ctrl-C to get you out cleanly: pool = threadpool.ThreadPool() pool.start() reactor.addSystemEventTrigger('after', 'shutdown', pool.stop) return wsgi.WSGIResource(reactor, pool, HandlerWrapper) WSGIRoot = wrapper_WSGIRootWrapper() # Reverse Proxy class Simple(Resource): isLeaf = False def getChild(self, name, request): if name == "orbited": print "orbited" return proxy.ReverseProxyResource('localhost', 12345, "/"+name) else: return WSGIRoot.getChildWithDefault(name, request) # Attaching proxy + django log_dir = './.log' if not os.path.exists(log_dir): os.makedirs(log_dir) reactor.listenTCP(DJANGO_PORT, server.Site(Simple(), logPath=os.path.join(log_dir, '.django.log'))) </code></pre> <p>My trouble is I don't really know what to fill in in the else part of that second code part. I looked at text_proxy on twisted-src and there weren't substantial examples for this. Any help? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload