Xavier-Lam / wechat-django

WeChat-Django旨在为接入微信公众平台的django开发者提供便捷的微信功能封装及最基本的后台管理支持
MIT License
198 stars 65 forks source link

didn't support django version 4.2.2 #22

Closed wshuaizki closed 1 year ago

wshuaizki commented 1 year ago

ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/home/ubuntu/taillyfox/py_virtual_env/lib/python3.10/site-packages/django/utils/translation/init.py)

Xavier-Lam commented 1 year ago

It has been a long time since last time I maintained the project, this project was tested up to django 2.2. It seemed ugettext_lazy has been removed since django 4. You should use gettext_lazy instead of ugettext_lazy. You can either to make a local installation and change all ugettext_lazy to gettext_lazy or make an ugly monkey patch, assign django.utils.translation.gettext_lazy to django.utils.translation.ugettext_lazy.

There may be other problems since django has upgraded 2 major versions, be careful if you want to use this project in production environment.

Reference: https://stackoverflow.com/a/71420374/4719118