Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions superset/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def init():
@manager.option(
'-d', '--debug', action='store_true',
help="Start the web server in debug mode")
@manager.option(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not well documented but it's similar to argparse, so you can action='store_true' as in

@manager.option(
    '-n', '--no-reload', action='store_true', dest='no_reload',
    help="Don't use the reloader in debug mode")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then no_reload has to be in the function args and will be bool

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thx.

'-n', '--no-reload', action='store_false', dest='no_reload',
default=config.get("FLASK_USE_RELOAD"),
help="Don't use the reloader in debug mode")
@manager.option(
'-a', '--address', default=config.get("SUPERSET_WEBSERVER_ADDRESS"),
help="Specify the address to which to bind the web server")
Expand All @@ -42,15 +46,16 @@ def init():
@manager.option(
'-t', '--timeout', default=config.get("SUPERSET_WEBSERVER_TIMEOUT"),
help="Specify the timeout (seconds) for the gunicorn web server")
def runserver(debug, address, port, timeout, workers):
def runserver(debug, no_reload, address, port, timeout, workers):
"""Starts a Superset web server"""
debug = debug or config.get("DEBUG")
if debug:
app.run(
host='0.0.0.0',
port=int(port),
threaded=True,
debug=True)
debug=True,
use_reloader=no_reload)
else:
cmd = (
"gunicorn "
Expand Down Expand Up @@ -117,13 +122,13 @@ def load_examples(load_test_data):
@manager.option(
'-d', '--datasource',
help=(
"Specify which datasource name to load, if omitted, all "
"datasources will be refreshed"))
"Specify which datasource name to load, if omitted, all "
"datasources will be refreshed"))
@manager.option(
'-m', '--merge',
help=(
"Specify using 'merge' property during operation. "
"Default value is False "))
"Specify using 'merge' property during operation. "
"Default value is False "))
def refresh_druid(datasource, merge):
"""Refresh druid datasources"""
session = db.session()
Expand Down
1 change: 1 addition & 0 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@

# Whether to run the web server in debug mode or not
DEBUG = False
FLASK_USE_RELOAD = True

# Whether to show the stacktrace on 500 error
SHOW_STACKTRACE = True
Expand Down