We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In particular, if you are trying to use a Cloud SQL Connection string and use POSTGIS as the engine it sets the database name as the host name.
If you are running on Google Cloud Run and want to connect to Google Cloud SQL instance with postgis, this will fail.
In [11]: POSTGRES = "postgres://user:password@//cloudsql/project-1234:us-central1:instance/dbname" In [12]: POSTGIS = "postgis://user:password@//cloudsql/project-1234:us-central1:instance/dbname" In [13]: Env.db_url_config(POSTGIS) Out[13]: {'NAME': '/cloudsql/project-1234:us-central1:instance/dbname', 'USER': 'user', 'PASSWORD': 'password', 'HOST': '', 'PORT': '', 'ENGINE': 'django.contrib.gis.db.backends.postgis'} In [14]: Env.db_url_config(POSTGRES) Out[14]: {'NAME': 'dbname', 'USER': 'user', 'PASSWORD': 'password', 'HOST': '/cloudsql/project-1234:us-central1:instance', 'PORT': '', 'ENGINE': 'django.db.backends.postgresql'}
The text was updated successfully, but these errors were encountered:
This is resolved in develop branch. Thank you for the report, and for helping us make django-environ better. And I am sorry about the delay.
develop
Sorry, something went wrong.
sergeyklay
Successfully merging a pull request may close this issue.
In particular, if you are trying to use a Cloud SQL Connection string and use POSTGIS as the engine it sets the database name as the host name.
If you are running on Google Cloud Run and want to connect to Google Cloud SQL instance with postgis, this will fail.
The text was updated successfully, but these errors were encountered: