Skip to content

Commit 088d2e1

Browse files
author
John
committed
fix: Added Django 4.0, Python 3.10, and DRF 3.13 support
1 parent b2d7a8d commit 088d2e1

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

src/rest_framework_jwt/compat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
try:
2121
from django.conf.urls import url
2222
except ImportError:
23-
from django.urls import url
23+
from django.urls import re_path as url
2424

2525

2626
if sys.version_info[0] == 2:

tests/views/test_authentication.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
from collections import OrderedDict
88

99
from django.utils.encoding import force_str
10-
from django.utils.translation import ugettext_lazy as _
10+
11+
try:
12+
from django.utils.translation import ugettext_lazy as _
13+
except ImportError:
14+
from django.utils.translation import gettext_lazy as _
1115

1216
from jwt import get_unverified_header
1317
from jwt.exceptions import InvalidAlgorithmError, InvalidSignatureError, InvalidTokenError

tests/views/test_impersonation.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
from __future__ import unicode_literals
44

5-
from django.utils.translation import ugettext_lazy as _
5+
6+
try:
7+
from django.utils.translation import ugettext_lazy as _
8+
except ImportError:
9+
from django.utils.translation import gettext_lazy as _
610

711
from rest_framework import status
812
from rest_framework.reverse import reverse

tox.ini

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ envlist =
1111
py{36,37}-dj22-drf{37,38,39,310}-pyjwt{1,2}-codecov
1212
py{36,37,38}-dj30-drf{311}-pyjwt{1,2}-codecov
1313
py{36,37,38}-dj{30,31,32}-drf{311,312}-pyjwt{1,2}-codecov
14-
py{39}-dj{30,31,32}-drf{311,312}-pyjwt{1,2}-codecov
14+
py{39,310}-dj{30,31,32}-drf{311,312,313}-pyjwt{1,2}-codecov
15+
py{39,310}-dj40-drf313-pyjwt{1,2}-codecov
1516

1617
[travis:env]
1718
TRAVIS =
@@ -34,12 +35,14 @@ deps =
3435
dj30: Django>=3.0,<3.1
3536
dj31: Django>=3.1,<3.2
3637
dj32: Django>=3.2,<3.3
38+
dj40: Django>=4.0,<4.1
3739
drf37: djangorestframework>=3.7,<3.8
3840
drf38: djangorestframework>=3.8,<3.9
3941
drf39: djangorestframework>=3.9,<3.10
4042
drf310: djangorestframework>=3.10,<3.11
4143
drf311: djangorestframework>=3.11,<3.12
4244
drf312: djangorestframework>=3.12,<3.13
45+
drf313: djangorestframework>=3.13,<3.14
4346
pyjwt1: PyJWT[crypto]>=1.5.2,<2.0.0
4447
pyjwt2: PyJWT[crypto]>=2.0.0,<3.0.0
4548
cryptography<3.4 # Avoiding the "needs Rust" versions

0 commit comments

Comments
 (0)