0 Replies
2 years ago
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.
2 years ago
show me the code that connects to the database please
2 years ago
show me where that database url variable is defined please
Its defined in settings.py
Lastly i am doing this


2 years ago
but that's just the word "postgres" I'm not sure what you are doing there
2 years ago
that's an empty string?
2 years ago
it should load the value from the environment variables
Settings.py imports BaseSetting which directly loads the env variables

2 years ago
have you done the classic debugging technique of printing the variable that you use in tortoise?
2 years ago
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.
2 years ago
its printing the scheme blank in your screenshot

2 years ago
right but seems like tortoise is ending up with a bad url
2 years ago
print the same value you are passing to tortoise, not just the environment variable

