• Register
Welcome to Kodlogs, programming questions and answer website.
+1 vote
39 views

Problem :

I am getting bellow flask app error
error: could not locate flask application. you did not provide the flask_app environment variable.
by (6.9k points)  

1 Answer

0 votes

Solution :

When I dropped sudo from sudo flask run, Flask finds $FLASK_APP. But, I got the error message socket.error as: [Errno 13] Permission denied. I can't see a way around this, as Flask cannot find $FLASK_APP when I run as superuser. 

Still I managed to run Flask by changing the port from 80 to 5000 and dropping sudo with flask run. This is running fine now. 

I was able to run flask db init after dropping and recreating my database, and removing calls to db.create_all.

by (36.1k points)  
...