Forums

New at flask deployment

Hello I am new to python and trying to deploy a small flask app that is working on my local environment. The app has a flask program inside of a .py file, and it serves up an HTML , and has a "/" route and one other route. It is a simple app with no database.

I'm trying to run these commands on the "Web" version of my flask app that's hosted on pythonanywhere.com

When I run this command in the bash console provided by pythonanywhere in mysite directory that is holding my flask_app.py file

pip install -r requirements.txt

(i'm not even 100% sure this is what I'm supposed to do.) I get this error:

Address already in use
Port 5000 is in use by another program. Either identify and stop that program, or start the server with a different port.

Can someone help me figure out how to get my simple app running? I'm very new to everything so please let me know the details I am leaving out.

Have a look at this help page on how to set up a flask app on PythonAnywhere.