Skip to content

config option for "flask run" (e.g. --dotenv/-e) #3108

@jab

Description

@jab

Would it make sense to allow passing a --config/-c option to flask run, that would then be exposed to users somehow for subsequent passing to e.g. app.config.from_pyfile()?

(I'm imagining this done in a reusable way so that a "flask gunicorn" custom command (the likes of which I've already implemented) could accept and expose a -c value similarly, so that the app could be configured from this same provided path whether running in development or production.)

This would reduce the dependence on an environment variable to specify this. Reason I ask is that many of the Flask users I'm supporting are allergic to environment variables for the reasons mentioned in #3095, and have been missing some way to pass a CLI option to flask run to help configure their apps. Thanks 😊

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions