• Register
1 vote
151 views

Problem :

I am getting bellow flask app error
error: could not locate flask application. you did not provide the flask_app environment variable.
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.

36.1k points

Related questions

0 votes
1 answer 394 views
394 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
1 vote
1 answer 155 views
155 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 samhaz 5k points
0 votes
1 answer 238 views
238 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 jwilliam 3.9k points
1 vote
1 answer 188 views
188 views
Problem : I am facing following sudo path error the command could not be located because '/bin' is not included in the path environment variable.
asked Nov 11, 2019 peterlaw 6.9k points
0 votes
1 answer 557 views
557 views
Problem : When I run my Python code I get the following exception: _csv.error: iterator should return strings, not bytes (did you open the file in text mode?)
asked Nov 18, 2019 peterlaw 6.9k points