Skip to content

Commit 8a5fc7f

Browse files
committed
Updates for latest Django supported versions
1 parent 8329c90 commit 8a5fc7f

File tree

12 files changed

+67
-61
lines changed

12 files changed

+67
-61
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ on:
99
jobs:
1010
tests:
1111
name: Python ${{ matrix.python-version }}
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-latest
1313

1414
strategy:
1515
matrix:
1616
python-version:
17-
- 3.6
18-
- 3.7
19-
- 3.8
20-
- 3.9
17+
- 3.10
18+
- 3.11
19+
- 3.12
20+
- 3.13
2121

2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2424

25-
- uses: actions/setup-python@v2
25+
- uses: actions/setup-python@v5
2626
with:
2727
python-version: ${{ matrix.python-version }}
2828

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ on:
88

99
jobs:
1010
pre-commit:
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515
with:
1616
fetch-depth: 0
1717

18-
- uses: actions/setup-python@v2
18+
- uses: actions/setup-python@v5
1919

2020
- uses: pre-commit/[email protected]
2121
with:

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ Writing the same code with `django-vanilla-views`, you'd instead arrive at a sim
9090

9191
## Requirements
9292

93-
* **Django**: 2.2, 3.0, 3.1, 3.2
94-
* **Python**: 3.6, 3.7, 3.8, 3.9
93+
* **Django**: 4.2, 5.0, 5.1, 5.2
94+
* **Python**: 3.10, 3.11, 3.12, 3.13
9595

9696
## Installation
9797

example/manage.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
#!/usr/bin/env python
2+
"""Django's command-line utility for administrative tasks."""
23
import os
34
import sys
45

5-
if __name__ == "__main__":
6+
7+
def main():
8+
"""Run administrative tasks."""
69
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings")
10+
try:
11+
from django.core.management import execute_from_command_line
12+
except ImportError as exc:
13+
raise ImportError(
14+
"Couldn't import Django. Are you sure it's installed and "
15+
"available on your PYTHONPATH environment variable? Did you "
16+
"forget to activate a virtual environment?"
17+
) from exc
18+
execute_from_command_line(sys.argv)
719

8-
from django.core.management import execute_from_command_line
920

10-
execute_from_command_line(sys.argv)
21+
if __name__ == "__main__":
22+
main()

example/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Django>=1.8
2-
django-vanilla-views==1.0.4
1+
Django>=4.2
2+
django-vanilla-views>=3.1.0

manage.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
#!/usr/bin/env python
2+
"""Django's command-line utility for administrative tasks."""
23
import os
34
import sys
45

5-
if __name__ == "__main__":
6+
7+
def main():
8+
"""Run administrative tasks."""
69
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testsettings")
10+
try:
11+
from django.core.management import execute_from_command_line
12+
except ImportError as exc:
13+
raise ImportError(
14+
"Couldn't import Django. Are you sure it's installed and "
15+
"available on your PYTHONPATH environment variable? Did you "
16+
"forget to activate a virtual environment?"
17+
) from exc
18+
execute_from_command_line(sys.argv)
719

8-
from django.core.management import execute_from_command_line
920

10-
execute_from_command_line(sys.argv)
21+
if __name__ == "__main__":
22+
main()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools >= 40.6.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[tool.black]
6-
target-version = ['py36']
6+
target-version = ['py310']
77

88
[tool.isort]
99
profile = "black"

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,16 @@ def get_package_data(package):
8383
"Changelog": "http://django-vanilla-views.org/topics/release-notes",
8484
"Repository": "https://github.com/tomchristie/django-vanilla-views/",
8585
},
86-
python_requires=">=3.6",
86+
python_requires=">=3.10",
8787
install_requires=[],
8888
classifiers=[
8989
"Development Status :: 5 - Production/Stable",
9090
"Environment :: Web Environment",
9191
"Framework :: Django",
92-
"Framework :: Django :: 2.2",
93-
"Framework :: Django :: 3.0",
94-
"Framework :: Django :: 3.1",
95-
"Framework :: Django :: 3.2",
92+
"Framework :: Django :: 4.2",
93+
"Framework :: Django :: 5.0",
94+
"Framework :: Django :: 5.1",
95+
"Framework :: Django :: 5.2",
9696
"Intended Audience :: Developers",
9797
"License :: OSI Approved :: BSD License",
9898
"Operating System :: OS Independent",

testsettings.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,13 @@
99

1010
INSTALLED_APPS = ("vanilla",)
1111

12-
if django.VERSION >= (1, 10):
13-
MIDDLEWARE = [
14-
"django.middleware.common.CommonMiddleware",
15-
"django.middleware.csrf.CsrfViewMiddleware",
16-
]
17-
else:
18-
MIDDLEWARE_CLASSES = [
19-
"django.middleware.common.CommonMiddleware",
20-
"django.middleware.csrf.CsrfViewMiddleware",
21-
]
12+
MIDDLEWARE = [
13+
"django.middleware.common.CommonMiddleware",
14+
"django.middleware.csrf.CsrfViewMiddleware",
15+
]
2216

2317
SECRET_KEY = "abcde12345"
2418

25-
if django.VERSION >= (3, 2):
26-
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
19+
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
20+
21+
USE_TZ = False

tox.ini

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
[tox]
22
isolated_build = True
33
envlist =
4-
py36-django{22,30,31,32}
5-
py37-django{22,30,31,32}
6-
py38-django{30,31,32}
7-
py39-django{30,31,32}
4+
py{310,311,312}-django{42,50,51,52}
5+
py313-django{51,52}
86

97
[testenv]
108
commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning manage.py test
119
deps =
12-
django22: django>=2.2,<3.0
13-
django30: django>=3.0,<3.1
14-
django31: django>=3.1,<3.2
15-
django32: django>=3.2,<4.0
10+
django42: django>=4.2,<5.0
11+
django50: django>=5.0,<5.1
12+
django51: django>=5.1,<5.2
13+
django52: django>=5.2b1,<6.0

0 commit comments

Comments
 (0)