Trying to run a python api

the api console says Running on http://127.0.0.1:5000 but a domain wasnt made and i cant access it. even with a munal domain it isnt working
Solution:
you would need gunicorn in your requirements.txt, and with that then your start command would likely need to be gunicorn flask_app:app assuming the flask constructor is named app
Jump to solution
13 Replies
Percy
Percy9mo ago
Project ID: e718dda2-ed4c-45dc-90ac-2e69b6e4e9f0
loyahdev
loyahdev9mo ago
e718dda2-ed4c-45dc-90ac-2e69b6e4e9f0
Brody
Brody9mo ago
what does "munal domain" mean?
loyahdev
loyahdev9mo ago
settings/public networking/generate domain
Brody
Brody9mo ago
you're trying to use a development server, please use gunicorn for flask
loyahdev
loyahdev9mo ago
i saw this:
gunicorn main:app
gunicorn main:app
how would I edit my python file? like down here?
if __name__ == '__main__':
app.run(debug=True)
if __name__ == '__main__':
app.run(debug=True)
Brody
Brody9mo ago
your start command needs to be what your first code block shows
loyahdev
loyahdev9mo ago
/bin/bash: line 1: gunicorn: command not found my main python file is called flask_app.py
Solution
Brody
Brody9mo ago
you would need gunicorn in your requirements.txt, and with that then your start command would likely need to be gunicorn flask_app:app assuming the flask constructor is named app
loyahdev
loyahdev9mo ago
yup it was that, thanks so much it works now
Brody
Brody9mo ago
no problem!
Want results from more Discord servers?
Add your server