Django4.0 ImportError:无法导入名称“ugettext_lazy”来自“django.utils.translation”
我在 Django 应用程序中使用翻译。由于我安装了 Django 版本 4,当我尝试导入 ugettexget_lazy
(如下面的代码所示)时,
from django.utils.translation import ugettexget_lazy as _
出现以下错误:
ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation'
I use translation in my Django apps. Since I installed Django version 4, when I try to import ugettexget_lazy
as shown in the code below
from django.utils.translation import ugettexget_lazy as _
I get the following error:
ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它已从 Django 4 中删除,请使用它
It was removed from Django 4, use this instead