Flask not working
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(port=5000)
31 Replies
Project ID:
a456ed59-7ab2-4b5a-bfdf-4717e08317e9
a456ed59-7ab2-4b5a-bfdf-4717e08317e9
Dev server detected!
thats why?
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 )alright let me try it
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
it worked
but
I have a discord bot
with it but its not loaded?
right here before it said discord logging in
a discord bot with a flask app? may i ask why?
because im hosting a dashboard with it also
and this will really help me out
you would need to start the discord bot in async mode
ah
I have it like this
how do i fix it?
Im sorry but we wouldnt be able to offer coding help here, these help threads are meant to provide platform help
ah okay
get it working locally with gunicorn and then we can can pick back up on this
isnt it already
is the discord bot running?
nope
then my statement stands
okay
may you please help out, i still dont understand how gunicorn is blocking it
Im sorry but we wouldnt be able to offer coding help here, these help threads are meant to provide platform help
yea i see why now
when i remove
gunicorn main:app
from the start command it goes back to dev and loads the discord botyou need to use gunicorn to run the flask app when on railway
do you know how i can allow the discord bot also?
again, sorry but we would not be able to offer code help here
no im asking what else do i put on the start command
nothing to do with the start command, this would be a code issue