comparison foodtruck/main.py @ 619:200c7063affa

admin: Change the default admin server port to 8090, add `--port` option.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 06 Feb 2016 21:47:24 -0800
parents c6bc0ef03f82
children 3885421c29a3
comparison
equal deleted inserted replaced
618:477dc9a63222 619:200c7063affa
2 2
3 3
4 logger = logging.getLogger(__name__) 4 logger = logging.getLogger(__name__)
5 5
6 6
7 def run_foodtruck(debug=False): 7 def run_foodtruck(host=None, port=None, debug=False):
8 if debug: 8 if debug:
9 import foodtruck.settings 9 import foodtruck.settings
10 foodtruck.settings.DEBUG = debug 10 foodtruck.settings.DEBUG = debug
11 11
12 from .web import app 12 from .web import app
13 try: 13 try:
14 app.run(debug=debug, threaded=True) 14 app.run(host=host, port=port, debug=debug, threaded=True)
15 except SystemExit: 15 except SystemExit:
16 # This is needed for Werkzeug's code reloader to be able to correctly 16 # This is needed for Werkzeug's code reloader to be able to correctly
17 # shutdown the child process in order to restart it (otherwise, SSE 17 # shutdown the child process in order to restart it (otherwise, SSE
18 # generators will keep it alive). 18 # generators will keep it alive).
19 from . import pubutil 19 from . import pubutil