我已经安装了django-smart-selects,但是当我在urls.py中添加url时
url(r'^chaining/', include('smart_selects.urls')),在此之后,当我运行我的应用程序时,我得到了以下错误
从django.utils.encoding导入force_text ImportError:无法从django.utils.encoding导入名称“force_text”
因此,在django.utils.encoding中,我没有找到任何导入force_text,所以我将其更改为force_str。
我正在使用django 4.0
发布于 2022-02-27 05:15:25
在系统库中,编辑以下文件:
变化: force_text.致: force_str
然后,编辑这个文件:
更改:从django.conf.urls导入url到:从django.urls导入re_path更改:url(.致:re_path(……
在项目文件夹中编辑urls.py
从django.urls导入包含、路径、re_path
图样= ..。re_path(r'^chaining/',包括(‘smart_selects.urls’),.
https://stackoverflow.com/questions/71256422
复制相似问题