Skip to content

Commit

Permalink
Do not leak key loop variable into global namespace (#226)
Browse files Browse the repository at this point in the history
This is a common problem for module level loops / helpers / etc.

`key` is importable name, it is even imported when using `from dj_database_url import *`. This is clearly not what we want.
  • Loading branch information
sobolevn authored Sep 26, 2023
1 parent 9292e1f commit f600d90
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dj_database_url/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# Register database schemes in URLs.
for key in SCHEMES.keys():
urlparse.uses_netloc.append(key)
del key


# From https://docs.djangoproject.com/en/4.0/ref/settings/#databases
Expand Down

0 comments on commit f600d90

Please sign in to comment.