Deploying issue: Python Flask server
Hi, first off thank you for helping, I have been trying to sort this most of the day 😄
I have a Flask server written in python that is running fine locally in VSCode, but when I try to run it with railway it is failing.
The deploy logs are showing:
But I am completely unsure why or where the issue is based on this. Any help at all would be the best for me thank you again
28 Replies
Project ID:
N/A
direful-jewel
what version of python are you using locally
Hi! 3.10.6 in VScode
what version is railway using
Where can I see that sorry?
I just removed all my return type annotation -> bool ect and its running now 🤔 maybe that was it! But when I make a request the public url on railway im getting 301 so maybe its still broken
at the top of the build logs
Ah yes, python 3.8
add a runtime.txt to your project with
3.10
in itOkay yep now its on 3.10
But still getting 301 when I try to access the server 🤔
that's a redirect, are you sure you are using https
My bad sorry! I now get 503 with https://
what's your current start command
For my python code?
the start command in use by railway
I havent set one so I think its just using main.py
please check
Okay I set it to "python main.py"
The deloy logs have
But still 503 for /cookies for example as well as all end points on my Flask server 🤔
you are running a development server
Solution
set your start command to
gunicorn main:app
Done but same outcome
Is it becuase its a flask server railway cant use it?
show me your deploy logs now please
oh shit this is flask lol, for some reason I thought this was fastapi
Is that better than flask? Happy to swap 🤣
fixed, but make sure you have gunicorn in your requirements.txt
Okay different logs
omg it worked
omg thank you so much Brody!!!
awesome
happy to help
This is awesome thank you so much
Really really great help
thanks 🙂