Saturday, March 25, 2017

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

Issue got resolved. More details: https://github.com/GoogleCloudPlatform/python-docs-samples/issues/870

On Wednesday, 22 March 2017 19:27:56 UTC+5:30, Kush Goyal wrote:
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/e0a55d46-618e-4e0d-826c-d0ff1cef184b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment