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:
Code used to run the app:
59 Replies
Project ID:
N/A
1110989921826656306
do you have a repo i could look at?
yes i do.
may i send you the files in DMs?
no thank you
okay then?
please send a link to your repo here
im sorry but this repo breaks railways tos, twice.
freeGPT, duckduckgo-search
both of these packages scrape data from the service unofficially
okay
i tried using duckduckgo's official JSON API but it did not work quite well
duckduck go no longer has an offical json api afaik
one sec tho, i will provide alternatives for you
nope, there is: https://api.duckduckgo.com/?q={query}&format=json
thats not a full search api btw
Yeah, that was the problem and I switched to duckduckgo-search
wait, are online APIs allowed?
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
but openai's official package is not free 😦
btw thanks a lot for your time and advice!
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
can I use alternative APIs that give GPT for free?
as a normal discord guy, i'm broke 💀
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
okay fine i guess
anything else is a big no no, and ive seen that it could result in a ban from railway
hey but you did not give me a fix to this problem 😦
yes i did
^
i used the flask template
from railway
no you didnt
hmm wait
oh yeah, i did now
can i have some reassurance that you will stop using those two packages, i really dont want you to randomly have your account banned
i will not use both of those.
and you understand why you cant use packages like those?
yeah, railway does not allow them
since they are not original
i understand.
perfect, thank you so much for understanding
i will change them, just let me try and run the flask app
if it works now
you can fork railway's flask app then use that as a starting point
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
happy to help
https://bot-production-3713.up.railway.app/ it does not work still ;-;
its not even giving me a error now
can i see your repo that you deployed that from?
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 thisyou must not be using gunicorn
what is that, i've not even heard about it
please use the railway flask template
yeah.... i am using it ;-;
you are not
the repository is still public, may you please check it?
send it
GitHub
GitHub - ruu3f-studio/RSearchX
Contribute to ruu3f-studio/RSearchX development by creating an account on GitHub.
this is not a fork of the railway flask template
and it still uses those two packages
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
lets start fresh with forking the railway flask template please, we dont want to continue using this repo
okay.
give me a minute.
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.
perfect!
that will work on railway
okay, so i will start adding my code without those two libraries
thanks!
keep the routes at the root level, before you had them in a function
and dont touch the procfile
yeah, i wont
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 🙂
thanks!
no problem, if you run into any troubles with railway feel free to come ask
okay.