I'm not able to run the flask application, the error is
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.
0
votes
What is your flask entry point file called? Are you running the command in the root of your flask project? Can you paste the setup code?
- Luv
I've attached the screenshot too, in the templates folder I've my index file, I want to open that index file with the help of localhost
- Harshit Ahluwalia
You can edit your question and use the code tag to paste the output instead of screenshots. I cannot see the name of your flask file.
- Luv
@Luv I've added the code for app.py file too
- Harshit Ahluwalia
1 Answers
1
votes
To get better pointed to the root of your problem answer, please specify what kind of operating system you are using. Usually, the problem is in the format of the command people use to set the value of the system variables. Check that you put spaces around '=' when you set the value in the command: if that is Windows environments then SET FLASK_APP = "app.py" OR $FLASK_APP = "app.py"