You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing flask run inside the hello folder, you will get a NoAppException error, although the app.py is present in the current work directory. By the current implementation, since .env is in the top-level directory, Flask will change the current work directory to the directory that contains the .env file, so it can't find the app.py.
Steps to reproduce:
$ git clone https://github.com/greyli/flask-env-test
$ cd flask-env-test
$ pip install -r requirements.txt # or just pip install flask[dotenv]
$ cd hello
$ flask run
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
Usage: flask run [OPTIONS]
Error: Could not locate a Flask application. You did not provide the "FLASK_APP" environment variable, and a "wsgi.py" or "app.py" module was not found in the current directory.
I think it will be a bit confused when the user accidentally put a .env or .flaskenv in the top-level directory. Can we drop this change directory behavior (#3560)?
Environment
Python version: 3.6.8
Flask version: 1.1.2
Werkzeug version: 1.0.1
The text was updated successfully, but these errors were encountered:
Description
With this minimal application:
and this file structure:
When executing
flask run
inside thehello
folder, you will get aNoAppException
error, although theapp.py
is present in the current work directory. By the current implementation, since.env
is in the top-level directory, Flask will change the current work directory to the directory that contains the.env
file, so it can't find theapp.py
.Steps to reproduce:
I think it will be a bit confused when the user accidentally put a
.env
or.flaskenv
in the top-level directory. Can we drop this change directory behavior (#3560)?Environment
The text was updated successfully, but these errors were encountered: