Skip to content
Myr

Use FLASK_DONT_LOAD_ENV flag to disable load .env

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

authored by Hsiaoming Yang · committed by David Lord · parent 4c8ec8f · Browse files · 1 file+4 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

1 file+4 added−1 removed

  • other:+4 added−1 removed

1 file+4 added−1 removed

modified:flask/cli.py+4 added-1 removed
542 unmodified lines
543 # call into a no-op. This is necessary to avoid ugly errors when the544 # script that is loaded here also attempts to start a server.545 os.environ['FLASK_RUN_FROM_CLI'] = 'true'546547 val = os.environ.get('FLASK_DONT_LOAD_ENV')548 load_dotenv = not val or val in ('0', 'false', 'no')549547 if self.load_dotenv:550 if self.load_dotenv and load_dotenv:551 load_dotenv()552553 obj = kwargs.get('obj')554
344 unmodified lines