gunicorn?
This commit is contained in:
@@ -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
@@ -125,8 +125,16 @@ class Servers:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def gunicorn(app,address, **options):
|
def gunicorn(app,address, **options):
|
||||||
import gunicorn.arbiter
|
from gunicorn.app.base import Application
|
||||||
gunicorn.arbiter.Arbiter(address, 4, app).run()
|
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
|
@staticmethod
|
||||||
def eventlet(app,address, **options):
|
def eventlet(app,address, **options):
|
||||||
@@ -294,7 +302,6 @@ def main():
|
|||||||
print 'starting %s on %s:%s...' % (options.server,options.ip,options.port)
|
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)
|
run(options.server,options.ip,options.port,logging=options.logging,profiler=options.profiler)
|
||||||
|
|
||||||
|
|
||||||
if __name__=='__main__':
|
if __name__=='__main__':
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user