2 years ago
django.db.utils.OperationalError: [Errno 11001 unable to connect to db
42 Replies
2 years ago
where do you get this error?
2 years ago
use railway ssh
2 years ago
please use railway ssh
railway login
Open the browser? Yes
Logged in as Tsh ([email protected])
PS C:\Users\toshd\Licenta - Copy (4)Chinezu\licentaRepo\backend> railway ssh
Expected welcome message, received: error
PS C:\Users\toshd\Licenta - Copy (4)Chinezu\licentaRepo\backend>
2 years ago
are you linked to the correct service?
2 years ago
correct
2 years ago
then run the command locally using the database public host and port
2 years ago
there is no template involved
DATABASES = {
'default': dj_database_url.config(default=os.environ.get('DATABASE_URL'))
} you mean like this ?
2 years ago
Yep, then use the public URL locally
2 years ago
please do not change anything on railway
i just tested with an entrance from local project . but didnt change anything in setup
2 years ago
please revert the changes you made in railway
2 years ago
you said your service on railway has crashed? what changes did you do to cause that?
it crashed after i changed to DATABASES = {
'default': dj_database_url.config(default=os.environ.get('DATABASE_URL'))
}
2 years ago
gotcha, you had the database url set to some render url
2 years ago
i've changed that for you
2 years ago
yeah
2 years ago
all good, your service is back online
so now i just keep my commands i dont need to pull variables like the cli version right ?
2 years ago
you need to use the public database url locally
2 years ago
!s
Status changed to Solved brody • over 1 year ago