Skip to content

Commit ffedc6b

Browse files
authored
Added support for Django 4.0 (#1010)
* Added support for Django 4.0 * Bump to Django 4.0 first release candidate
1 parent 83d84d0 commit ffedc6b

11 files changed

+20
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ any parts of the framework not mentioned in the documentation should generally b
1010

1111
## [Unreleased]
1212

13+
### Added
14+
15+
* Added support for Django 4.0.
16+
1317
### Fixed
1418

1519
* Adjusted error messages to correctly use capital "JSON:API" abbreviation as used in the specification.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Requirements
8989
------------
9090

9191
1. Python (3.6, 3.7, 3.8, 3.9)
92-
2. Django (2.2, 3.0, 3.1, 3.2)
92+
2. Django (2.2, 3.0, 3.1, 3.2, 4.0)
9393
3. Django REST framework (3.12)
9494

9595
We **highly** recommend and only officially support the latest patch release of each Python, Django and REST framework series.

docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ like the following:
5252
## Requirements
5353

5454
1. Python (3.6, 3.7, 3.8, 3.9)
55-
2. Django (2.2, 3.0, 3.1, 3.2)
55+
2. Django (2.2, 3.0, 3.1, 3.2, 4.0)
5656
3. Django REST framework (3.12)
5757

5858
We **highly** recommend and only officially support the latest patch release of each Python, Django and REST framework series.

example/settings/dev.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
MEDIA_ROOT = os.path.normcase(os.path.dirname(os.path.abspath(__file__)))
77
MEDIA_URL = "/media/"
8+
USE_TZ = False
89

910
DATABASE_ENGINE = "sqlite3"
1011

example/urls_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from django.conf.urls import re_path
1+
from django.urls import re_path
22
from rest_framework import routers
33

44
from .api.resources.identity import GenericIdentity, Identity
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
django-filter==21.1
2-
django-polymorphic==3.0.0
2+
django-polymorphic==3.1.0
33
pyyaml==6.0
44
uritemplate==4.1.1

requirements/requirements-testing.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ pytest-cov==3.0.0
66
pytest-django==4.4.0
77
pytest-factoryboy==2.1.0
88
syrupy==1.4.7
9+
# TODO remove pytz dep again once DRF higher than 3.12.4 is released
10+
# Django 4.0 removed dependency on pytz and made it optional but
11+
# DRF requires it and will define it as dependency in future versions
12+
# only adding this to testing though as DJA does not directly use pytz
13+
pytz==2021.3

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ DJANGO_SETTINGS_MODULE=example.settings.test
5858
filterwarnings =
5959
error::DeprecationWarning
6060
error::PendingDeprecationWarning
61-
# Django Debug Toolbar currently (2021-04-07) specifies default_app_config which is deprecated in Django 3.2:
62-
ignore:'debug_toolbar' defines default_app_config = 'debug_toolbar.apps.DebugToolbarConfig'. Django now detects this configuration automatically. You can remove default_app_config.:PendingDeprecationWarning
61+
# TODO remove again once DRF higher than 3.12.4 has been released
62+
ignore:'rest_framework' defines default_app_config
6363
# TODO remove in next major version of DJA 5.0.0
6464
# this deprecation warning filter needs to be added as AuthorSerializer is used in
6565
# too many tests which introduced the type field name in tests

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def get_package_data(package):
9797
install_requires=[
9898
"inflection>=0.3.0",
9999
"djangorestframework>=3.12,<3.13",
100-
"django>=2.2,<3.3",
100+
"django>=2.2,<4.1",
101101
],
102102
extras_require={
103103
"django-polymorphic": ["django-polymorphic>=2.0"],

tests/test_relations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
from django.conf.urls import re_path
2+
from django.urls import re_path
33
from rest_framework import status
44
from rest_framework.fields import SkipField
55
from rest_framework.routers import SimpleRouter

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[tox]
22
envlist =
33
py{36,37,38,39}-django{22,30,31,32}-drf{312,master},
4+
py{38,39}-django40-drf{312,master},
45
lint,docs
56

67
[testenv]
@@ -9,6 +10,7 @@ deps =
910
django30: Django>=3.0,<3.1
1011
django31: Django>=3.1,<3.2
1112
django32: Django>=3.2,<3.3
13+
django40: Django>=4.0rc1,<5.0
1214
drf312: djangorestframework>=3.12,<3.13
1315
drfmaster: https://github.com/encode/django-rest-framework/archive/master.zip
1416
-rrequirements/requirements-testing.txt

0 commit comments

Comments
 (0)