20 Replies
Project ID:
42cb5f33-ac30-472f-be18-06847d544555
42cb5f33-ac30-472f-be18-06847d544555
going to need more information, are you trying to connect to a database hosted on railway?
Yes postgres hosted on railway in the same project. I have added DATABASE_URL as the env variable but its still throwing this error. I have multiple such projects running and everything works fine. Only in this project i am facing this issue.
show me the code that connects to the database please
show me where that database url variable is defined please
Its defined in settings.py
Lastly i am doing this
that's an empty string?
it should load the value from the environment variables
Settings.py imports BaseSetting which directly loads the env variables
The empty string was the placeholder value
have you done the classic debugging technique of printing the variable that you use in tortoise?
Yes it is getting recognized
I am getting the db value
@Brody any idea on how i can fix this
at first glace this is kinda looking like its loading variables from a file?
I tried logging the db url that the app is connecting to and the url looks fine.
its printing the scheme blank in your screenshot
Logged the db here
right but seems like tortoise is ending up with a bad url
Any idea how i can debug that?
print the same value you are passing to tortoise, not just the environment variable