Wednesday, March 22, 2017

[google-cloud-sql-discuss] Postgresql Django settings

I am not able to connect to postgres db from app engine flexi environment.

These are the settings I am using:

in django settings file:

DATABASES = {
    'default': {
            'ENGINE': 'django.db.backends.postgresql',
            'NAME': '<db-name>',
            'USER': '<user-name>',
            'PASSWORD': '<password>',
            'HOST': '/cloudsql/<instanse-connection-name>',
            'PORT': '5432'
        },
}

in app.yaml:

beta_settings:
    cloud_sql_instances: <instanse-connection-name>

The error I am getting is this:

could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/cloudsql/<instanse-connection-name>/.s.PGSQL.5432"?

Please help.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/63b65d63-fd2d-4f8b-92b2-d4a5b8e73118%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment