Flask app not working
hey there am very new to railway, i would love to get some help, I am not familiar with hosting a website either. i would appreciate it if someone could walk me through setting it up, I've seen some youtube tutorials about hosting a flask app on railway but none of them worked for some reason.
31 Replies
Project ID:
b18dbcc6-1581-49d3-9f4b-7a0659942430
proejct id: b18dbcc6-1581-49d3-9f4b-7a0659942430
Hey, railway provides an env variable
port
. Could you ensure your app is listening on this, rather than 5000
or however it is currently configured?how can I do that
sorry but I've never hosted an app before
Can you share your repo?
GitHub
GitHub - AhmedMurad22/PastPaperHelper
Contribute to AhmedMurad22/PastPaperHelper development by creating an account on GitHub.
Change like this
oh it worked
but now
i get this error after pressing one of the buttons
i think because tabula-py relies on java
I think here you need to add java as one of the build providers. If that doesn't work, someone smarter than me might have to help. 🙂
ill try that :)
wait..
I dont have that option in settings
Oh, you need to join priority boarding for that apparently. There's also a way to do it with config file I'm sure but I'm on my phone now and not the most familiar with it.
You can join that with
/beta
oh alright, thank you man, appreciate the help!! <3
hey there man 🤣
new day new error
Did adding java in the profiders work? I think you can just add a
nixpacks.toml
file in your root with or something like this
This looks like an error with your code. There is no year.
It should be like this:i added java in the providers
year = request.form.get('year')
if year:
your code
now this is the error that it gives
how does it work perfectly fine on a local host then??
where do I add this text?
Are you sure you selected a year when you receive this error? if you use
year = request.form['year']
and there is no year selected you will get an error. if you do something like:
then it will set the year to 2022 if no year is selected, hope this helpsit works perfectly fine in a local host
am pretty sure the problem is not with "year"
year = request.form['year']
will be a null value and you cant use it if year is not selected on the formbut im just using year as an example, it's the same for all the fields
I'm not sure why it works locally unless you had selected all the fields
the website requests a pdf from a different website, does that have anything to do with it?
thats really weird
ill look at your code again shortly but you should put some error handling to flash a message to your user if they forgot to fill out the whole form https://flask.palletsprojects.com/en/2.3.x/patterns/flashing/
alr man thanks!!
it shouldn't be an issue
in a
railway.toml
file in your root directoryConfiguring Builds | Nixpacks
App source + Nix packages + Docker = Image