MoritzS / jinja2-django-tags

jinja2 extensions that add django tags
MIT License
41 stars 10 forks source link

Django 4.0+ compatibility #14

Open M1ha-Shvn opened 6 months ago

M1ha-Shvn commented 6 months ago

In Django 4.0+ an ImportError exception is raised on from django.utils.encoding import force_text as it is renamed to forse_str

imLew commented 5 months ago

This can "fixed" by monkey patching the methods

from django.utils.encoding import force_str
from django.utils.translation import gettext
from django.utils.translation import ngettext
django.utils.encoding.force_text = force_str
django.utils.translation.ugettext = gettext
django.utils.translation.ungettext = ngettext