Django with PostgreSQL sample

Issues information

Your issue

I am following the tutorial Deploy Django with PostgreSQL with Qovery
But from what I can see in the logs, there is an error when connecting to the database:

django.db.utils.OperationalError: could not connect to server: Connection refused
	Is the server running on host "localhost" (127.0.0.1) and accepting
	TCP/IP connections on port 5432?
could not connect to server: Address not available
	Is the server running on host "localhost" (::1) and accepting
	TCP/IP connections on port 5432?

Hi @paco020295, welcome to the Qovery community :slight_smile:

From what I see you may have forgotten to connect your app to your PostgreSQL database. You need to set up the correct environment variable - I found this article that could help you to configure Django and PostegreSQL How to Start Django Project with a Database(PostgreSQL) | by stackpython | Medium

Let me know

Hello @rophilogene

Thanks for the response. From the documentation in the tutorial:

The sample application is preconfigured to use those environment variables to connect to the database.

And i can see the credentials are present in the Environment Variables in Qovery