• Register
1 vote

Problem :

I am getting bellow flask app error
error: could not locate flask application. you did not provide the flask_app environment variable.
6 5 3
6,930 points

Please log in or register to answer this question.

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.

9 7 4
38,600 points

Related questions

1 vote
1 answer 2K views
Problem: I installed flask in my system by running the command: pip install flask Collecting flask Downloading https://files.pythonhosted.org/packages/f2/28/2a03252dfb9ebf377f40fba6a7841b47083260bf8bd8e737b0c6952df83f/Flask-1.1.2-py2.py3-none-any.whl (94kB) |████████████████████████████████| ... operable program or batch file. Whats the problem running this can any one tell me? Thanks in advance.
asked May 12, 2020 samhaz 5k points
0 votes
1 answer 1.1K views
Problem : I am trying to deploy my Python Flask application in my Azure web app. I had created web app(Flask) and published the code. After publishing it, I am facing below error from the site. The page cannot be displayed because an internal server error ... . But this was the case only in my subscription(my free subscription with MSDN). But it was working fine in the Organisation subscription.
asked Dec 16, 2019 alecxe 7.5k points
0 votes
0 answers 1 view
1 view
Problem: Is there anyone who can tell me what is the use of flask?
asked 21 hours ago niyatiry 2.9k points
0 votes
1 answer 17 views
Problem: warning: do not use the development server in a production environment.
asked Feb 12 Dan phillip 4.7k points
0 votes
1 answer 6 views
Problem: how to Solve this: flask pymongo HELP! I need help understanding this: flask pymongo Can someone please help solve this, I am new in python(). Someone have idea to solve this thanks!
asked Mar 13 Mashhoodch 13k points
0 votes
1 answer 3 views
Problem I wonder if someone could help me with What is a flask used for? Can anyone please suggest?
asked Mar 11 neeraj 9.5k points
0 votes
1 answer 12 views
Problem : valueerror: view function did not return a response.
asked Feb 18 Shovo210 13.2k points
0 votes
1 answer 460 views
Problem : I am trying to do the file upload & enter the data task into my MongoDB using a flask but I had below error when I filled my form & upload my image: “Bad Request The browser (or proxy) sent a request that this server could ... mypassword, 'email': myemail, 'img_name': file_name})         return render_template('index.html')     else:         return render_template('index.html')
asked Jan 22, 2020 jwilliam 3.9k points
0 votes
1 answer 2 views
Problem: What are my options for dealing with this issue? bad request your browser sent a query this server could not understand.
asked Apr 1 rakib1 51.3k points
0 votes
1 answer 5 views
Problem: Anyone knows about this error so please tell me .. no python application found check your startup logs for errors
asked Apr 2 Ifra 24.4k points