R
Railway10mo ago
loyahdev

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
Percy10mo ago
Project ID: e718dda2-ed4c-45dc-90ac-2e69b6e4e9f0
loyahdev
loyahdevOP10mo ago
e718dda2-ed4c-45dc-90ac-2e69b6e4e9f0
Brody
Brody10mo ago
what does "munal domain" mean?
loyahdev
loyahdevOP10mo ago
settings/public networking/generate domain
Brody
Brody10mo ago
you're trying to use a development server, please use gunicorn for flask
loyahdev
loyahdevOP10mo 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
Brody10mo ago
your start command needs to be what your first code block shows
loyahdev
loyahdevOP10mo ago
/bin/bash: line 1: gunicorn: command not found my main python file is called flask_app.py
Solution
Brody
Brody10mo 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
loyahdevOP10mo ago
yup it was that, thanks so much it works now
Brody
Brody10mo ago
no problem!
Want results from more Discord servers?
Add your server