Skip to content
Myr

add `exclude-patterns` option to `flask run`

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

authored by Mickaël Guérin · committed by David Lord · parent e06dad6 · Browse files · 3 files+33 added−1 removed
This commit

State

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

Diff stats

3 files+33 added−1 removed

  • other:+33 added−1 removed

3 files+33 added−1 removed

modified:docs/cli.rst+9 added
260 unmodified lines
261 * Running on http://127.0.0.1:8000/262 * Detected change in '/path/to/file1', reloading263264265Ignore files with the Reloader266~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~267268The reloader can also ignore files using :mod:`fnmatch` patterns with269the ``--exclude-patterns`` option, or the ``FLASK_RUN_EXCLUDE_PATTERNS``270environment variable. Multiple patterns are separated with ``:``, or271``;`` on Windows.272273274Debug Mode275----------276277Debug mode will be enabled when :envvar:`FLASK_ENV` is ``development``,
443 unmodified lines
modified:src/flask/cli.py+21 added-1 removed
794 unmodified lines
795 "Extra files that trigger a reload on change. Multiple paths"796 f" are separated by {os.path.pathsep!r}."797 ),798)799@click.option(800 "--exclude-patterns",801 default=None,802 type=SeparatedPathType(),803 help=(804 "Files matching these fnmatch patterns will not trigger a reload"805 " on change. Multiple patterns are separated by"806 f" {os.path.pathsep!r}."807 ),808)809@pass_script_info810def run_command(801 info, host, port, reload, debugger, eager_loading, with_threads, cert, extra_files811 info,812 host,813 port,814 reload,815 debugger,816 eager_loading,817 with_threads,818 cert,819 extra_files,820 exclude_patterns,821):822 """Run a local development server.823824 This server is for development purposes only. It does not provide
23 unmodified lines
848 use_debugger=debugger,849 threaded=with_threads,850 ssl_context=cert,851 extra_files=extra_files,852 exclude_patterns=exclude_patterns,853 )854855856@click.command("shell", short_help="Run a shell in the app context.")
125 unmodified lines
modified:CHANGES.rst+3 added
37 unmodified lines
38- The CLI uses ``importlib.metadata`` instead of ``setuptools`` to39 load command entry points. :issue:`4419`40- Overriding ``FlaskClient.open`` will not cause an error on redirect.41 :issue:`3396`42- Add an ``--exclude-patterns`` option to the ``flask run`` CLI43 command to specify patterns that will be ignored by the reloader.44 :issue:`4188`454647Version 2.0.348-------------
1199 unmodified lines