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

Document that user, password, and db name should be urlencoded #108

Closed melinath closed 2 years ago

melinath commented 6 years ago

I ran into an issue today deploying usage of dj-database-url to production, which had a password that included a non-url-safe character. Since putting usernames / passwords into urls is not something I've done a lot of, I didn't know that quoting was necessary (and I wasn't even sure it would work.)

I ended up finding this web page, which mentioned that quoting was needed: https://support.brightcove.com/special-characters-usernames-and-passwords

The error I got was:

File "/usr/lib/python2.7/urlparse.py", line 214, in urlsplit
    raise ValueError("Invalid IPv6 URL")

It would be great if the documentation for dj-database-url could include a note about this. It doesn't seem like there would be a good way to catch this error and re-raise with more helpful information, unfortunately, but if I'm mistaken then that would also be great.

mattseymour commented 2 years ago

This requirement has been added to the readme.rst in commit 836740dd814878c