Skip to content
New issue

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

Allow colons (%3A) in percent-encoded paths #66

Closed
jdp opened this issue Jun 7, 2016 · 2 comments
Closed

Allow colons (%3A) in percent-encoded paths #66

jdp opened this issue Jun 7, 2016 · 2 comments
Labels
feature this is a request for a new feature

Comments

@jdp
Copy link

jdp commented Jun 7, 2016

Postgres supports percent-encoded paths to allow for connecting to the DB over a domain socket since this change, and it would be super helpful to allow percent-encoded colons as well. That way, dj-database-url could be used with Google Cloud SQL, because its socket names are in the format /cloudsql/{project-id}:{sql-instance-id}. Without percent-encoding the colon, it gets interpreted as an invalid port. Adding it would support connection strings like this, like Postgres:

>>> dj_database_url.parse('mysql://root@%2fcloudsql%2fproject-id%3asql-id/database')
{'ENGINE': 'django.db.backends.mysql', 'HOST': '/cloudsql/project-id:sql-id', 'NAME': 'database', 'CONN_MAX_AGE': 0, 'PASSWORD': '', 'PORT': '', 'USER': 'root'}

I have an existing patch if that would be helpful.

jdp referenced this issue in LiveLike/dj-database-url Jun 8, 2016
Adds support for other special characters in UNIX socket path
names, like the colons in Cloud SQL paths.

See also:  https://github.com/kennethreitz/dj-database-url/issues/66
@kennethreitz
Copy link
Collaborator

A patch would be great.

@jacobian jacobian added the feature this is a request for a new feature label Jul 24, 2019
@palfrey
Copy link
Member

palfrey commented Dec 12, 2022

Implemented by #181 which is now merged

@palfrey palfrey closed this as completed Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature this is a request for a new feature
Projects
None yet
Development

No branches or pull requests

4 participants