server: make gunicorn friendly

This commit is contained in:
rr- 2017-01-20 23:51:51 +01:00
parent 6b42d787a7
commit e5f250260d
2 changed files with 4 additions and 2 deletions

View file

@ -10,7 +10,7 @@ import argparse
import os.path
import sys
import waitress
from szurubooru.facade import create_app
from szurubooru.facade import app
def main():
parser = argparse.ArgumentParser('Starts szurubooru using waitress.')
@ -19,7 +19,6 @@ def main():
parser.add_argument('--host', help='IP to listen on', default='0.0.0.0')
args = parser.parse_args()
app = create_app()
waitress.serve(app, host=args.host, port=args.port)
if __name__ == '__main__':

View file

@ -113,3 +113,6 @@ def create_app():
rest.errors.handle(sqlalchemy.orm.exc.StaleDataError, _on_stale_data_error)
return rest.application
app = create_app()