2014-01-14 01:07:13 +02:00
|
|
|
from gevent import wsgi
|
2013-12-09 22:24:22 +02:00
|
|
|
from realms import config, app, manager
|
2014-08-30 18:06:12 +03:00
|
|
|
from flask.ext.script import Server
|
|
|
|
|
|
|
|
manager.add_command("runserver", Server(host="0.0.0.0", port=config.PORT))
|
2013-12-03 22:09:57 +02:00
|
|
|
|
2013-09-26 16:51:15 +03:00
|
|
|
|
2013-12-09 22:24:22 +02:00
|
|
|
@manager.command
|
2014-08-30 18:06:12 +03:00
|
|
|
def run():
|
|
|
|
"""
|
|
|
|
Run production ready server
|
|
|
|
"""
|
2014-08-20 18:28:25 +03:00
|
|
|
print "Server started. Env: %s Port: %s" % (config.ENV, config.PORT)
|
|
|
|
wsgi.WSGIServer(('', int(config.PORT)), app).serve_forever()
|
2013-12-09 22:24:22 +02:00
|
|
|
|
2014-01-14 01:07:13 +02:00
|
|
|
|
2013-09-26 16:51:15 +03:00
|
|
|
if __name__ == '__main__':
|
2013-12-09 22:24:22 +02:00
|
|
|
manager.run()
|