jazzband / dj-database-url

Use Database URLs in your Django Application.
https://pypi.org/project/dj-database-url/
BSD 3-Clause "New" or "Revised" License
1.48k stars 205 forks source link

Support Google Cloud SQL connect sockets #148

Closed jared-hardy closed 1 year ago

jared-hardy commented 2 years ago

Support Google Cloud SQL connect sockets, fulfill README claim [2], and fix for issue #132.

We use this PyPI package import at work now, and I see some other PR's I'd like to integrate here, so I'm willing to take over maintenance at my fork. I can also rename to use a different PyPI package name if desired.

jared-hardy commented 2 years ago

By using the upstream URL Parser library to decode any % encoded URL hostname, I hope to shortcut some of the prior discussion of legal URL hostname minutia. All that discussion should remain in the upstream libraries. This code converts from that legal URL pattern to the database libraries' expected HOST value string pattern, which in most (all?) cases means complete % pattern decoding before this setting value is passed. This implementation has the nice side benefit of supporting Google Cloud SQL connection sockets, as cited by all current related Issues, and in the added unit test case.

palfrey commented 1 year ago

Obsoleted by https://github.com/jazzband/dj-database-url/pull/181 which is now merged