Mercurial > piecrust2
comparison piecrust/commands/builtin/serving.py @ 890:f77f9dcba072
serve: Optionally run the admin panel with the server.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 02 Jul 2017 22:15:47 -0700 |
parents | 4850f8c21b6e |
children | 33a89139c284 |
comparison
equal
deleted
inserted
replaced
889:942565723e99 | 890:f77f9dcba072 |
---|---|
28 parser.add_argument( | 28 parser.add_argument( |
29 '--use-debugger', | 29 '--use-debugger', |
30 help="Show the debugger when an error occurs", | 30 help="Show the debugger when an error occurs", |
31 action='store_true') | 31 action='store_true') |
32 parser.add_argument( | 32 parser.add_argument( |
33 '--admin', | |
34 help="Also serve the administration panel.", | |
35 action='store_true') | |
36 parser.add_argument( | |
33 '--wsgi', | 37 '--wsgi', |
34 help="The WSGI server implementation to use", | 38 help="The WSGI server implementation to use", |
35 choices=['werkzeug', 'gunicorn'], | 39 choices=['werkzeug', 'gunicorn'], |
36 default='werkzeug') | 40 default='werkzeug') |
37 | 41 |
43 | 47 |
44 if ctx.args.wsgi == 'werkzeug': | 48 if ctx.args.wsgi == 'werkzeug': |
45 from piecrust.serving.wrappers import run_werkzeug_server | 49 from piecrust.serving.wrappers import run_werkzeug_server |
46 run_werkzeug_server( | 50 run_werkzeug_server( |
47 appfactory, host, port, | 51 appfactory, host, port, |
52 serve_admin=ctx.args.admin, | |
48 use_debugger=debug, | 53 use_debugger=debug, |
49 use_reloader=ctx.args.use_reloader) | 54 use_reloader=ctx.args.use_reloader) |
50 | 55 |
51 elif ctx.args.wsgi == 'gunicorn': | 56 elif ctx.args.wsgi == 'gunicorn': |
52 from piecrust.serving.wrappers import run_gunicorn_server | 57 from piecrust.serving.wrappers import run_gunicorn_server |