gunicorn?

This commit is contained in:
Massimo Di Pierro
2012-04-17 10:24:57 -05:00
parent 9c46c107f3
commit acd9fa0951
2 changed files with 11 additions and 4 deletions
+1 -1
View File
@@ -1 +1 @@
Version 1.99.7 (2012-04-17 10:01:57) dev
Version 1.99.7 (2012-04-17 10:24:27) dev
+10 -3
View File
@@ -125,8 +125,16 @@ class Servers:
@staticmethod
def gunicorn(app,address, **options):
import gunicorn.arbiter
gunicorn.arbiter.Arbiter(address, 4, app).run()
from gunicorn.app.base import Application
config = {'bind': "%s:%d" % address}
config.update(options)
class GunicornApplication(Application):
def init(self, parser, opts, args):
return config
def load(self):
return app
g = GunicornApplication()
g.run()
@staticmethod
def eventlet(app,address, **options):
@@ -294,7 +302,6 @@ def main():
print 'starting %s on %s:%s...' % (options.server,options.ip,options.port)
run(options.server,options.ip,options.port,logging=options.logging,profiler=options.profiler)
if __name__=='__main__':
main()