Closed Metarizard closed 2 years ago
As Django 4.0 made its release, some features were deprecated (https://docs.djangoproject.com/en/4.0/releases/4.0/#features-removed-in-4-0). In particular, django.utils.encoding.force_text() was removed (its use had been deprecated since Django 3.0 - https://docs.djangoproject.com/en/3.0/ref/utils/#django.utils.encoding.force_text). In the current state, this method is being used in sweetify/encoders.py so ImportErrors will be raised from Django 4.0 onward, as reported in #29 .
django.utils.encoding.force_text()
sweetify/encoders.py
ImportError
This PR solves #29 by changing force_text to force_str, method that can be used with previous versions (from Django 1.8 to Django 2.2 - https://docs.djangoproject.com/en/1.8/ref/utils/#django.utils.encoding.force_str, https://docs.djangoproject.com/en/2.2/ref/utils/#django.utils.encoding.force_str) so this fix is backwards compatible.
force_text
force_str
Thanks :)!
As Django 4.0 made its release, some features were deprecated (https://docs.djangoproject.com/en/4.0/releases/4.0/#features-removed-in-4-0). In particular,
django.utils.encoding.force_text()
was removed (its use had been deprecated since Django 3.0 - https://docs.djangoproject.com/en/3.0/ref/utils/#django.utils.encoding.force_text). In the current state, this method is being used insweetify/encoders.py
soImportError
s will be raised from Django 4.0 onward, as reported in #29 .This PR solves #29 by changing
force_text
toforce_str
, method that can be used with previous versions (from Django 1.8 to Django 2.2 - https://docs.djangoproject.com/en/1.8/ref/utils/#django.utils.encoding.force_str, https://docs.djangoproject.com/en/2.2/ref/utils/#django.utils.encoding.force_str) so this fix is backwards compatible.