Closed dominik-bln closed 4 years ago
@dominik-bln Thanks for reporting this. :slightly_smiling_face:
You can merge the first two try/except
blocks. Could you please send a PR with this change?
Ok, will do.
I've opened https://github.com/Styria-Digital/django-rest-framework-jwt/pull/45 to address this.
@fitodic I've checked again regarding merging the two blocks. From the Django v3 docs it looks like include
should come from django.urls
and url
from django.conf.urls
. I've switched that around now, otherwise a similar problem could likely crop up again when importing url
from django.urls
gets deprecated.
Added one more to fix a deprecation of force_text
in https://github.com/Styria-Digital/django-rest-framework-jwt/pull/46
I've opened #45 to address this.
@fitodic I've checked again regarding merging the two blocks. From the Django v3 docs it looks like
include
should come fromdjango.urls
andurl
fromdjango.conf.urls
. I've switched that around now, otherwise a similar problem could likely crop up again when importingurl
fromdjango.urls
gets deprecated.
Great :+1:
We recently updated from Django 2 to Django 3 and are now seeing quite a few deprecation warnings regarding
RemovedInDjango40Warning: django.utils.translation.ugettext() is deprecated in favor of django.utils.translation.gettext()
coming from this package.I believe this is caused by the try-catch block in
compat.py
being "reused" for multiple imports where the first line seems to fail in Django 3:https://github.com/Styria-Digital/django-rest-framework-jwt/blob/master/src/rest_framework_jwt/compat.py#L12
It looks like
url
is not part ofdjango.conf
and therefore always raisesImportError
:https://docs.djangoproject.com/en/3.0/ref/urls/
I believe the following should fix the problem in
compat.py
, I'm just not completely sure if the middle block even makes sense or of it should be completely removed: