Mercurial > piecrust2
view foodtruck/main.py @ 777:8d633ca59bc5
admin: Fixes for the Git support.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 04 Jul 2016 00:22:30 -0700 |
parents | 3885421c29a3 |
children |
line wrap: on
line source
import logging logger = logging.getLogger(__name__) def run_foodtruck(host=None, port=None, debug=False): if debug: import foodtruck.settings foodtruck.settings.DEBUG = debug from .web import create_foodtruck_app try: app = create_foodtruck_app() app.run(host=host, port=port, debug=debug, threaded=True) except SystemExit: # This is needed for Werkzeug's code reloader to be able to correctly # shutdown the child process in order to restart it (otherwise, SSE # generators will keep it alive). from . import pubutil logger.debug("Shutting down SSE generators from main...") pubutil.server_shutdown = True raise