Reputation: 1377
I have install django-smart-selects
but when i add the url in the urls.py
url(r'^chaining/', include('smart_selects.urls')),
when i run my application after this i got this error
from django.utils.encoding import force_text ImportError: cannot import name 'force_text' from 'django.utils.encoding'
so here in django.utils.encoding
I didn't find any import force_text
so I change it to force_str
.
I am using django 4.0
Upvotes: 0
Views: 795
Reputation: 68
In your system libraries, edit this files:
change: force_text. to: force_str
Then, edit this file:
change: from django.conf.urls import url to: from django.urls import re_path change: url(... to: re_path(...
in your project folder, edit urls.py
from django.urls import include, path, re_path
urlpatterns = [ ... re_path(r'^chaining/', include('smart_selects.urls')), ... ]
Upvotes: 1