a year ago
Hi I have my project and when I deploy it theres no errors but when i go onto the website where its being hosted I get server error but I have my app.run like this [app.run](app.run)(port=5000)
0 Replies
a year ago
Dev server detected!
a year ago
Your app needs to use 0.0.0.0
as the host ( like the message box at the top says )
You're also running a development server, you'll want to use gunicorn to run your server
to do that, add gunicorn to requirements.txt
your start command would look something like this gunicorn main:app -b [::]:5000
( you can set it in service settings )
a year ago
gunicorn main:app
will suffice in most cases
so yea i did both of what you guys told me into my start command and it gives out this
a year ago
a discord bot with a flask app? may i ask why?
a year ago
you would need to start the discord bot in async mode
```def run_flask():
app.run(port=5000)
def run_discord():
bot.run(TOKEN)
if name == "main":
flaskthread = threading.Thread(target=runflask)
discordthread = threading.Thread(target=rundiscord)
flaskthread.start() discordthread.start()
flaskthread.join() discordthread.join()```
a year ago
Im sorry but we wouldnt be able to offer coding help here, these help threads are meant to provide platform help
a year ago
get it working locally with gunicorn and then we can can pick back up on this
a year ago
is the discord bot running?
a year ago
then my statement stands
may you please help out, i still dont understand how gunicorn is blocking it
a year ago
Im sorry but we wouldnt be able to offer coding help here, these help threads are meant to provide platform help
when i remove gunicorn main:app
from the start command it goes back to dev and loads the discord bot
a year ago
you need to use gunicorn to run the flask app when on railway
a year ago
again, sorry but we would not be able to offer code help here
a year ago
nothing to do with the start command, this would be a code issue