I am trying to login to the admin portal, however I am getting the below error. Please help I have been searching for solution but nothing
Exception Type: ImportError at /admin/login/ Exception Value: cannot import name 'urlquote' from 'django.utils.http' (C:_project\my-events\env\lib\site-packages\django\utils\http.py)
In Django 4, django.utils.http.urlquote()
, urlquote_plus()
, urlunquote()
, and urlunquote_plus()
are deprecated in favor of the functions that they’re aliases for: urllib.parse.quote()
, quote_plus()
, unquote()
, and unquote_plus()
.
Downgrade to Django 3 to fix your issue. However, if you still want to use Django 4 and above, you can fix the issue by changing the reference of these functions. For your case, add the following to the top of settings.py:
from urllib.parse import quote
django.utils.http.urlquote = quote
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With