Reputation: 11
I am facing this error "OperationalError at /results/ connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections? connection to server at "localhost" (::1), port 5432 failed: Cannot assign requested address Is the server running on that host and accepting TCP/IP connections?" when I try to run a django application that I just deployed in railway.app. What is the problem and how can I fix?
When I run the application locally it works well, it is my first time deploying a django application to production and I have no idea how to solve that issue, your help is greatly appreciated.
Upvotes: 1
Views: 1151
Reputation: 11
I just realized that the error is due to not using railway's database. Apparently it was running localhost and my postgres' port, created a postgres database in railway and connected to the deployed django app and it is now working well. Thank you @Laurenz Albe for reminding me that.
Upvotes: 0