Skip to content
Myr

Document the debug param for Flask.run, it is not part of **options given to run_simple.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

I am not sure bool() is appropriate.

authored by Simon Sapin · committed by Ron DuPlain · parent 899f8cd · Browse files · 1 file+4 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−3 removed

  • other:+4 added−3 removed

1 file+4 added−3 removed

modified:flask/app.py+4 added-3 removed
655 unmodified lines
656 # easier add new variables in context processors without breaking657 # existing views.658 context.update(orig_ctx)659660 def run(self, host='127.0.0.1', port=5000, **options):660 def run(self, host='127.0.0.1', port=5000, debug=None, **options):661 """Runs the application on a local development server. If the662 :attr:`debug` flag is set the server will automatically reload663 for code changes and show a debugger in case an exception happened.664
14 unmodified lines
679680 :param host: the hostname to listen on. set this to ``'0.0.0.0'``681 to have the server available externally as well.682 :param port: the port of the webserver683 :param debug: if given, enable or disable debug mode.684 :param options: the options to be forwarded to the underlying685 Werkzeug server. See686 :func:`werkzeug.serving.run_simple` for more687 information.688 """689 from werkzeug.serving import run_simple689 if 'debug' in options:690 self.debug = options.pop('debug')690 if debug is not None:691 self.debug = bool(debug)692 options.setdefault('use_reloader', self.debug)693 options.setdefault('use_debugger', self.debug)694 try:695 run_simple(host, port, self, **options)
857 unmodified lines