R
Railway•2y ago
Ruu3f

Flask app not running on the Railway domain

I know it can be the problem that I am bad at coding, but asking for help is a thing soo.... Error:
* Serving Flask app 'main'
* Debug mode: off
Name or service not known
* Serving Flask app 'main'
* Debug mode: off
Name or service not known
Code used to run the app:
app.run(host="0.0.0.0:$PORT")
app.run(host="0.0.0.0:$PORT")
59 Replies
Percy
Percy•2y ago
Project ID: N/A
Ruu3f
Ruu3fOP•2y ago
1110989921826656306
Brody
Brody•2y ago
do you have a repo i could look at?
Ruu3f
Ruu3fOP•2y ago
yes i do. may i send you the files in DMs?
Brody
Brody•2y ago
no thank you
Ruu3f
Ruu3fOP•2y ago
okay then?
Brody
Brody•2y ago
please send a link to your repo here
Ruu3f
Ruu3fOP•2y ago
okay, its private though. Let me make it public https://github.com/.../... thank you by the way.
Brody
Brody•2y ago
im sorry but this repo breaks railways tos, twice. freeGPT, duckduckgo-search both of these packages scrape data from the service unofficially
Ruu3f
Ruu3fOP•2y ago
okay i tried using duckduckgo's official JSON API but it did not work quite well
Brody
Brody•2y ago
duckduck go no longer has an offical json api afaik one sec tho, i will provide alternatives for you
Brody
Brody•2y ago
thats not a full search api btw
Ruu3f
Ruu3fOP•2y ago
Yeah, that was the problem and I switched to duckduckgo-search wait, are online APIs allowed?
Brody
Brody•2y ago
use this flask template https://github.com/railwayapp-templates/flask for search, google has a full search api, and they have a python package to use it https://developers.google.com/custom-search/v1/introduction for chatgpt, use openai's official package https://pypi.org/project/openai/ explain what you mean by online
Ruu3f
Ruu3fOP•2y ago
but openai's official package is not free 😦 btw thanks a lot for your time and advice!
Brody
Brody•2y ago
correct it is not entirely free, you do get 5$ from them though but yeah you need to be using official apis for the services you are using, both those packages do not use official apis
Ruu3f
Ruu3fOP•2y ago
can I use alternative APIs that give GPT for free? as a normal discord guy, i'm broke 💀
Brody
Brody•2y ago
absolutely not, that would break both openai's tos and thus railway's tos you need to be using official apis, with your own api keys
Ruu3f
Ruu3fOP•2y ago
okay fine i guess
Brody
Brody•2y ago
anything else is a big no no, and ive seen that it could result in a ban from railway
Ruu3f
Ruu3fOP•2y ago
hey but you did not give me a fix to this problem 😦
Brody
Brody•2y ago
yes i did ^
Ruu3f
Ruu3fOP•2y ago
i used the flask template from railway
Brody
Brody•2y ago
no you didnt
Ruu3f
Ruu3fOP•2y ago
hmm wait oh yeah, i did now
Brody
Brody•2y ago
can i have some reassurance that you will stop using those two packages, i really dont want you to randomly have your account banned
Ruu3f
Ruu3fOP•2y ago
i will not use both of those.
Brody
Brody•2y ago
and you understand why you cant use packages like those?
Ruu3f
Ruu3fOP•2y ago
yeah, railway does not allow them since they are not original i understand.
Brody
Brody•2y ago
perfect, thank you so much for understanding
Ruu3f
Ruu3fOP•2y ago
i will change them, just let me try and run the flask app if it works now
Brody
Brody•2y ago
you can fork railway's flask app then use that as a starting point
Ruu3f
Ruu3fOP•2y ago
yeah, i started from it and then.. got lost now i fixed my code, it should work thank you for your time and assistance btw
Brody
Brody•2y ago
happy to help
Ruu3f
Ruu3fOP•2y ago
https://bot-production-3713.up.railway.app/ it does not work still ;-; its not even giving me a error now
Brody
Brody•2y ago
can i see your repo that you deployed that from?
Ruu3f
Ruu3fOP•2y ago
nevermind, i found the error Looks like your app is listening on 127.0.0.1. You may need to listen on 0.0.0.0 instead. yeah this
Brody
Brody•2y ago
you must not be using gunicorn
Ruu3f
Ruu3fOP•2y ago
what is that, i've not even heard about it
Brody
Brody•2y ago
please use the railway flask template
Ruu3f
Ruu3fOP•2y ago
yeah.... i am using it ;-;
Brody
Brody•2y ago
you are not
Ruu3f
Ruu3fOP•2y ago
the repository is still public, may you please check it?
Brody
Brody•2y ago
send it
Ruu3f
Ruu3fOP•2y ago
GitHub
GitHub - ruu3f-studio/RSearchX
Contribute to ruu3f-studio/RSearchX development by creating an account on GitHub.
Brody
Brody•2y ago
this is not a fork of the railway flask template and it still uses those two packages
Ruu3f
Ruu3fOP•2y ago
yeah, i will remove those two later I used the 'Flask' template when making my railway app and then i added my code to it
Brody
Brody•2y ago
lets start fresh with forking the railway flask template please, we dont want to continue using this repo
Ruu3f
Ruu3fOP•2y ago
okay. give me a minute.
Ruu3f
Ruu3fOP•2y ago
Okay, i deleted the repository and created a new one with the original flask template: https://github.com/ruu3f-studio/RSearchX
GitHub
GitHub - ruu3f-studio/RSearchX
Contribute to ruu3f-studio/RSearchX development by creating an account on GitHub.
Brody
Brody•2y ago
perfect! that will work on railway
Ruu3f
Ruu3fOP•2y ago
okay, so i will start adding my code without those two libraries thanks!
Brody
Brody•2y ago
keep the routes at the root level, before you had them in a function and dont touch the procfile
Ruu3f
Ruu3fOP•2y ago
yeah, i wont
Brody
Brody•2y ago
perfect, and you can use those two alternatives i linked to achieve the same functionality as your old app had, just this time it wont break tos 🙂
Ruu3f
Ruu3fOP•2y ago
thanks!
Brody
Brody•2y ago
no problem, if you run into any troubles with railway feel free to come ask
Ruu3f
Ruu3fOP•2y ago
okay.
Want results from more Discord servers?
Add your server