Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
wants to merge 1 commit into from

3 participants

@SimonSapin

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

I am not sure bool() is appropriate.

@SimonSapin SimonSapin Document the debug param for Flask.run, it is not part of **options g…
…iven to run_simple.


I am not sure bool() is appropriate.
9135908
@Poincare

It isn't passed to run_simple, but, it seems to be assumed to be contained in **options gived to run() since it is popped.

@SimonSapin

I understand how it currently works, but having debug explicitly in Flask.run’s signature makes it appear in the Sphinx documentation, which the patch does.

@rduplain
Collaborator

Thanks, subtle but important clarification.

@rduplain rduplain closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 23, 2011
  1. @SimonSapin

    Document the debug param for Flask.run, it is not part of **options g…

    SimonSapin authored
    …iven to run_simple.
    
    
    I am not sure bool() is appropriate.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 3 deletions.
  1. +4 −3 flask/app.py
View
7 flask/app.py
@@ -524,7 +524,7 @@ def update_template_context(self, context):
# existing views.
context.update(orig_ctx)
- def run(self, host='127.0.0.1', port=5000, **options):
+ def run(self, host='127.0.0.1', port=5000, debug=None, **options):
"""Runs the application on a local development server. If the
:attr:`debug` flag is set the server will automatically reload
for code changes and show a debugger in case an exception happened.
@@ -547,14 +547,15 @@ def run(self, host='127.0.0.1', port=5000, **options):
:param host: the hostname to listen on. set this to ``'0.0.0.0'``
to have the server available externally as well.
:param port: the port of the webserver
+ :param debug: if given, enable or disable debug mode.
:param options: the options to be forwarded to the underlying
Werkzeug server. See
:func:`werkzeug.serving.run_simple` for more
information.
"""
from werkzeug.serving import run_simple
- if 'debug' in options:
- self.debug = options.pop('debug')
+ if debug is not None:
+ self.debug = bool(debug)
options.setdefault('use_reloader', self.debug)
options.setdefault('use_debugger', self.debug)
return run_simple(host, port, self, **options)
Something went wrong with that request. Please try again.