django-rest-knox icon indicating copy to clipboard operation
django-rest-knox copied to clipboard

ugettext_lazy is deprecated causing warnings

Open AlecRichardson opened this issue 4 years ago • 2 comments

https://github.com/James1345/django-rest-knox/pull/214

https://github.com/James1345/django-rest-knox/blob/develop/knox/auth.py#L10

  /usr/local/lib/python3.8/site-packages/knox/auth.py:63: RemovedInDjango40Warning: django.utils.translation.ugettext_lazy() is deprecated in favor of django.utils.translation.gettext_lazy().
    msg = _('Invalid token.')

Docs: https://docs.pytest.org/en/latest/warnings.html

AlecRichardson avatar Jul 09 '20 16:07 AlecRichardson

Looks like this change made it in. Would love to see a release going out with this and #232

sdebnath avatar Oct 19 '20 05:10 sdebnath

After upgrading python 3.8.1 to version 3.8.10, I am seeing following error

\lib\site-packages\knox\auth.py", line 11, in <module>
    from django.utils.translation import ugettext_lazy as _
ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation'

Pipfile:

django = ">=4.0"
djangorestframework = "~=3.13.1"
django-rest-knox = ">=4.1.0"
django-imagekit = ">=4.1.0"

[requires]
python_version = "3.8.10"

mamtach avatar Dec 26 '21 09:12 mamtach