Merge ~shanepelletier/django-preflight:SN1842-upgrade-to-django3.2 into django-preflight:master

Proposed by Shane M. Pelletier
Status: Merged
Approved by: Shane M. Pelletier
Approved revision: 7033f90d20a6121c446a1e7bb77c53155cf86d14
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~shanepelletier/django-preflight:SN1842-upgrade-to-django3.2
Merge into: django-preflight:master
Diff against target: 201 lines (+18/-54)
9 files modified
doc/install.rst (+2/-2)
example_project/example_project/settings.py (+1/-2)
example_project/example_project/urls.py (+2/-2)
preflight/models.py (+1/-1)
preflight/tests.py (+1/-1)
preflight/urls.py (+2/-2)
preflight/views.py (+1/-1)
setup.py (+2/-1)
tox.ini (+6/-42)
Reviewer Review Type Date Requested Status
David Approve
Review via email: mp+447994@code.launchpad.net

Commit message

Upgrade to Django >= 3.2

To post a comment you must log in.
Revision history for this message
David (lofidevops) wrote :

LGTM!

review: Approve
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
7033f90... by Shane M. Pelletier

Fix doctest

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/doc/install.rst b/doc/install.rst
2index d8dfe41..bcf655e 100644
3--- a/doc/install.rst
4+++ b/doc/install.rst
5@@ -52,13 +52,13 @@ should look like the following:
6
7 .. testcode::
8
9- from django.conf.urls import include, url
10+ from django.urls import include, re_path
11
12 import preflight
13 preflight.autodiscover()
14
15 urlpatterns = [
16- url(r'^preflight/', include('preflight.urls')),
17+ re_path(r'^preflight/', include('preflight.urls')),
18 ]
19
20 .. testoutput::
21diff --git a/example_project/example_project/settings.py b/example_project/example_project/settings.py
22index ca540b3..58a50f0 100644
23--- a/example_project/example_project/settings.py
24+++ b/example_project/example_project/settings.py
25@@ -27,12 +27,11 @@ INSTALLED_APPS = [
26 'app',
27 ]
28
29-MIDDLEWARE_CLASSES = [
30+MIDDLEWARE = [
31 'django.contrib.sessions.middleware.SessionMiddleware',
32 'django.middleware.common.CommonMiddleware',
33 'django.middleware.csrf.CsrfViewMiddleware',
34 'django.contrib.auth.middleware.AuthenticationMiddleware',
35- 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
36 'django.contrib.messages.middleware.MessageMiddleware',
37 'django.middleware.clickjacking.XFrameOptionsMiddleware',
38 ]
39diff --git a/example_project/example_project/urls.py b/example_project/example_project/urls.py
40index 04dc288..b1cb34a 100644
41--- a/example_project/example_project/urls.py
42+++ b/example_project/example_project/urls.py
43@@ -1,10 +1,10 @@
44 # Copyright 2010 Canonical Ltd. This software is licensed under the
45 # GNU Affero General Public License version 3 (see the file LICENSE).
46 import preflight
47-from django.conf.urls import include, url
48+from django.urls import include, re_path
49
50 preflight.autodiscover()
51
52 urlpatterns = [
53- url(r'^preflight/', include('preflight.urls')),
54+ re_path(r'^preflight/', include('preflight.urls')),
55 ]
56diff --git a/preflight/models.py b/preflight/models.py
57index fb98037..e0940c0 100644
58--- a/preflight/models.py
59+++ b/preflight/models.py
60@@ -16,10 +16,10 @@ import django
61 from django import db
62 from django.conf import settings
63 from django.core.cache import caches
64-from django.views.debug import HIDDEN_SETTINGS
65
66 from .conf import ENABLE_SETTINGS
67
68+HIDDEN_SETTINGS = re.compile(r"API|TOKEN|KEY|SECRET|PASS|SIGNATURE|HTTP_COOKIE", flags=re.IGNORECASE)
69 REGISTRY = []
70
71
72diff --git a/preflight/tests.py b/preflight/tests.py
73index 8fd1e7f..ee6fc7e 100644
74--- a/preflight/tests.py
75+++ b/preflight/tests.py
76@@ -15,7 +15,7 @@ import six
77 from django.contrib.auth.models import AnonymousUser, User
78 from django.conf import settings
79 from django.core.management import call_command
80-from django.core.urlresolvers import reverse
81+from django.urls import reverse
82 from django.http import HttpResponse
83 from django.test import TestCase
84 from django.template import RequestContext
85diff --git a/preflight/urls.py b/preflight/urls.py
86index ddc9f75..a9e89aa 100644
87--- a/preflight/urls.py
88+++ b/preflight/urls.py
89@@ -3,13 +3,13 @@ from __future__ import unicode_literals
90 # GNU Affero General Public License version 3 (see the file LICENSE).
91
92 import django
93-from django.conf.urls import url
94+from django.urls import re_path
95
96 import preflight.views
97
98
99 urlpatterns = [
100- url(r'^$', preflight.views.overview, name='preflight-overview'),
101+ re_path(r'^$', preflight.views.overview, name='preflight-overview'),
102 ]
103
104 if django.VERSION[:2] < (1, 10):
105diff --git a/preflight/views.py b/preflight/views.py
106index 5db1a32..cad9046 100644
107--- a/preflight/views.py
108+++ b/preflight/views.py
109@@ -77,7 +77,7 @@ def check_basic_auth(request):
110 def allow_basic_auth(f):
111 @functools.wraps(f)
112 def wrapper(self, request):
113- if not request.user.is_authenticated():
114+ if not request.user.is_authenticated:
115 basic_user = check_basic_auth(request)
116 if basic_user is not None:
117 request.user = basic_user
118diff --git a/setup.py b/setup.py
119index 31ba70e..1dbadaf 100644
120--- a/setup.py
121+++ b/setup.py
122@@ -57,7 +57,8 @@ setup(
123 },
124 install_requires=[
125 'django >= 1.4',
126- 'future >= 0.15.2'
127+ 'future >= 0.15.2',
128+ 'six'
129 ],
130 tests_require=tests_require,
131 extras_require={
132diff --git a/tox.ini b/tox.ini
133index 60ef9c0..e1a754f 100644
134--- a/tox.ini
135+++ b/tox.ini
136@@ -1,8 +1,7 @@
137 [tox]
138 envlist =
139- py27-django1.7, py27-django1.8, py27-django1.9, py27-django1.10, py27-django1.11,
140- py35-django1.11,
141- docs
142+ py36, py37, py38, py39, docs
143+skip_missing_interpreters = true
144
145 [testenv]
146 commands=python manage.py test preflight
147@@ -11,6 +10,9 @@ deps =
148 pip == 18.1
149 mock > 0.6
150 pyquery
151+ django>=3.2
152+ six
153+ future
154 install_command = pip install {opts} {packages}
155
156 [testenv:docs]
157@@ -19,42 +21,4 @@ changedir=doc
158 deps=sphinx
159 commands=
160 sphinx-build -b doctest -d {envtmpdir}/doctrees . {envtmpdir}/doctest
161- sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
162-
163-[testenv:py27]
164-basepython = python2.7
165-
166-[testenv:py35]
167-basepython = python3.5
168-
169-[testenv:py27-django1.7]
170-deps =
171- {[testenv]deps}
172- gargoyle >= 0.6.0
173- django >= 1.7, < 1.8
174-
175-[testenv:py27-django1.8]
176-deps =
177- {[testenv]deps}
178- gargoyle >= 0.6.0
179- django >= 1.8, < 1.9
180-
181-[testenv:py27-django1.9]
182-deps =
183- {[testenv]deps}
184- django >= 1.9, < 1.10
185-
186-[testenv:py27-django1.10]
187-deps =
188- {[testenv]deps}
189- django >= 1.10, < 1.11
190-
191-[testenv:py27-django1.11]
192-deps =
193- {[testenv]deps}
194- django >= 1.11, < 1.12
195-
196-[testenv:py35-django1.11]
197-deps =
198- {[testenv]deps}
199- django >= 1.11, < 1.12
200+ sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
201\ No newline at end of file

Subscribers

People subscribed via source and target branches