show 'run --debug' in docs
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Reverts commit 4d69165ab6e17fa754139d348cdfd9edacbcb999. Now that a release has this option, it's ok to show it in the docs. It had been reverted because the 2.2.x docs showed it before 2.2.3 was released.
authored by David Lord · committed by David Lord · parent b945f98 · Browse files · 8 files·+23 added−15 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
8 files+23 added−15 removed
- other:+23 added−15 removed
Provenance
- Commit
24df8fc- Tree
9e3be90- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
b945f98
8 files changed+23 added−15 removed
modified:docs/tutorial/factory.rst+1 added-1 removed
135 unmodified lines136 follow the tutorial.137 138 .. code-block:: text139 140- $ flask --app flaskr --debug run140+ $ flask --app flaskr run --debug141 142 You'll see output similar to this:143 144 .. code-block:: text18 unmodified linesmodified:docs/cli.rst+10 added-2 removed
93 unmodified lines94 the ``--debug`` option.95 96 .. code-block:: console97 98- $ flask --app hello --debug run98+ $ flask --app hello run --debug99 * Serving Flask app "hello"100 * Debug mode: on101 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)102 * Restarting with inotify reloader103 * Debugger is active!104 * Debugger PIN: 223-456-919105 106+The ``--debug`` option can also be passed to the top level ``flask`` command to enable107+debug mode for any command. The following two ``run`` calls are equivalent.108 109+.. code-block:: console110+111+ $ flask --app hello --debug run112+ $ flask --app hello run --debug113+114+115 Watch and Ignore Files with the Reloader116 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~117 118 When using debug mode, the reloader will trigger whenever your Python code or imported438 unmodified lines557 558 Click the *Script path* dropdown and change it to *Module name*, then input ``flask``.559 560 The *Parameters* field is set to the CLI command to execute along with any arguments.553-This example uses ``--app hello --debug run``, which will run the development server in561+This example uses ``--app hello run --debug``, which will run the development server in562 debug mode. ``--app hello`` should be the import or file with your Flask app.563 564 If you installed your project as a package in your virtualenv, you may uncheck the565 *PYTHONPATH* options. This will more accurately match how you deploy later.6 unmodified linesmodified:docs/config.rst+6 added-6 removed
45 unmodified lines46 ----------47 48 The :data:`DEBUG` config value is special because it may behave inconsistently if49 changed after the app has begun setting up. In order to set debug mode reliably, use the50-``--debug`` option on the ``flask`` command. ``flask run`` will use the interactive51-debugger and reloader by default in debug mode.50+``--debug`` option on the ``flask`` or ``flask run`` command. ``flask run`` will use the51+interactive debugger and reloader by default in debug mode.52 53 .. code-block:: text54 55- $ flask --app hello --debug run55+ $ flask --app hello run --debug56 57 Using the option is recommended. While it is possible to set :data:`DEBUG` in your58-config or code, this is strongly discouraged. It can't be read early by the ``flask run``59-command, and some systems or extensions may have already configured themselves based on60-a previous value.58+config or code, this is strongly discouraged. It can't be read early by the59+``flask run`` command, and some systems or extensions may have already configured60+themselves based on a previous value.61 62 63 Builtin Configuration Values64 ----------------------------716 unmodified linesmodified:docs/debugging.rst+2 added-2 removed
41 unmodified lines42 The debugger is enabled by default when the development server is run in debug mode.43 44 .. code-block:: text45 46- $ flask --app hello --debug run46+ $ flask --app hello run --debug47 48 When running from Python code, passing ``debug=True`` enables debug mode, which is49 mostly equivalent.50 20 unmodified lines71 which can interfere.72 73 .. code-block:: text74 75- $ flask --app hello --debug run --no-debugger --no-reload75+ $ flask --app hello run --debug --no-debugger --no-reload76 77 When running from Python:78 79 .. code-block:: python8 unmodified linesmodified:docs/quickstart.rst+1 added-1 removed
106 unmodified lines107 To enable debug mode, use the ``--debug`` option.108 109 .. code-block:: text110 111- $ flask --app hello --debug run111+ $ flask --app hello run --debug112 * Serving Flask app 'hello'113 * Debug mode: on114 * Running on http://127.0.0.1:5000 (Press CTRL+C to quit)115 * Restarting with stat792 unmodified linesmodified:docs/server.rst+1 added-1 removed
22 unmodified lines23 debug mode.24 25 .. code-block:: text26 27- $ flask --app hello --debug run27+ $ flask --app hello run --debug28 29 This enables debug mode, including the interactive debugger and reloader, and then30 starts the server on http://localhost:5000/. Use ``flask run --help`` to see the31 available options, and :doc:`/cli` for detailed instructions about configuring and using84 unmodified linesmodified:examples/celery/README.md+1 added-1 removed
17 unmodified lines181920212222232425262717 unmodified linesIn a separate terminal, activate the virtualenv and run the Flask development server.
```shell$ . ./.venv/bin/activate$ flask -A task_app --debug run$ flask -A task_app run --debug```
Go to http://localhost:5000/ and use the forms to submit tasks. You can see the pollingrequests in the browser dev tools and the Flask logs. You can see the tasks submittingand completing in the Celery logs.modified:examples/tutorial/README.rst+1 added-1 removed
46 unmodified lines47 48 .. code-block:: text49 50 $ flask --app flaskr init-db51- $ flask --app flaskr --debug run51+ $ flask --app flaskr run --debug52 53 Open http://127.0.0.1:5000 in a browser.54 55 13 unmodified lines