Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define reloader extra_files in flask run CLI #2897

Closed
rochacbruno opened this issue Aug 31, 2018 · 3 comments
Closed

Define reloader extra_files in flask run CLI #2897

rochacbruno opened this issue Aug 31, 2018 · 3 comments
Labels
Milestone

Comments

@rochacbruno
Copy link
Contributor

@rochacbruno rochacbruno commented Aug 31, 2018

Expected Behavior

I expected to have FLASK_RUN_EXTRA_FILES to be processed in the same way of FLASK_RUN_PORT and FLASK_RUN_HOST

When using the old style app.run we can define an extra_files to be watched for changes by the reloader, that is useful for example, if you have a static settings file like settings.toml (using dynaconf) or another kind of static config or themed templates loaded from other paths

Actual Behavior

In the run command https://github.com/pallets/flask/blob/master/flask/cli.py#L775 the argument extra_files is not being passed to wekzeug.run_simple https://github.com/pallets/werkzeug/blob/master/werkzeug/serving.py#L738

Suggestion

Add FLASK_RUN_EXTRA_FILES="path1,path2,path" to flask run command.

or

Map all variables from werkzeug.run_simple - https://github.com/pallets/werkzeug/blob/master/werkzeug/serving.py#L738

In to FLASK_RUN_* prefixed env var or WERKZEUG_RUN_* prefixed env var.

Environment

  • Python version: 3.6
  • Flask version: 1.0.2
  • Werkzeug version: 0.14.1
@rochacbruno
Copy link
Contributor Author

@rochacbruno rochacbruno commented Aug 31, 2018

I can provide a Pull Request to add this, just let me know what you think about it.

Loading

@RonnyPfannschmidt
Copy link
Contributor

@RonnyPfannschmidt RonnyPfannschmidt commented Aug 31, 2018

i believe adding a argument/cli option for the extra files should fit the expectations well
i'd like @davidism 's input on this as well

Loading

@davidism
Copy link
Member

@davidism davidism commented Aug 31, 2018

I'm fine with adding it.

Loading

rochacbruno added a commit to rochacbruno/flask that referenced this issue Aug 31, 2018
rochacbruno added a commit to rochacbruno/flask that referenced this issue Aug 31, 2018
rochacbruno added a commit to rochacbruno/flask that referenced this issue Aug 31, 2018
rochacbruno added a commit to rochacbruno/flask that referenced this issue Sep 18, 2018
davidism added a commit to rochacbruno/flask that referenced this issue May 24, 2019
@davidism davidism added this to the 1.1.0 milestone May 24, 2019
@davidism davidism added the cli label May 24, 2019
davidism added a commit that referenced this issue May 24, 2019
Fix #2897 - Add `extra_files` option to `flask run` CLI
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants