Skip to content

Commit 13e489f

Browse files
committed
django 4.2 docs
1 parent a7306c4 commit 13e489f

File tree

10 files changed

+28
-28
lines changed

10 files changed

+28
-28
lines changed

codeforlife/models/abstract_base_session.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
class AbstractBaseSession(_AbstractBaseSession):
3030
"""
3131
Base session class to be inherited by all session classes.
32-
https://docs.djangoproject.com/en/3.2/topics/http/sessions/#example
32+
https://docs.djangoproject.com/en/4.2/topics/http/sessions/#example
3333
"""
3434

3535
pk: str # type: ignore[assignment]

codeforlife/models/abstract_base_user.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
class AbstractBaseUser(_AbstractBaseUser):
2323
"""
2424
Base user class to be inherited by all user classes.
25-
https://docs.djangoproject.com/en/3.2/topics/auth/customizing/#using-a-custom-user-model-when-starting-a-project
25+
https://docs.djangoproject.com/en/4.2/topics/auth/customizing/#using-a-custom-user-model-when-starting-a-project
2626
"""
2727

2828
pk: int

codeforlife/models/base_session_store.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class BaseSessionStore(
3232
):
3333
"""
3434
Base session store class to be inherited by all session store classes.
35-
https://docs.djangoproject.com/en/3.2/topics/http/sessions/#example
35+
https://docs.djangoproject.com/en/4.2/topics/http/sessions/#example
3636
"""
3737

3838
@classmethod

codeforlife/models/signals/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Created on 14/03/2024 at 12:52:50(+00:00).
44
55
Helpers for module "django.db.models.signals".
6-
https://docs.djangoproject.com/en/3.2/ref/signals/#module-django.db.models.signals
6+
https://docs.djangoproject.com/en/4.2/ref/signals/#module-django.db.models.signals
77
"""
88

99
from .general import UpdateFields, update_fields_includes

codeforlife/models/signals/post_save.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Created on 20/06/2024 at 11:46:02(+01:00).
44
55
Helpers for module "django.db.models.signals.post_save".
6-
https://docs.djangoproject.com/en/3.2/ref/signals/#post-save
6+
https://docs.djangoproject.com/en/4.2/ref/signals/#post-save
77
"""
88

99
import typing as t

codeforlife/models/signals/pre_save.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Created on 14/03/2024 at 13:08:13(+00:00).
44
55
Helpers for module "django.db.models.signals.pre_save".
6-
https://docs.djangoproject.com/en/3.2/ref/signals/#pre-save
6+
https://docs.djangoproject.com/en/4.2/ref/signals/#pre-save
77
"""
88

99
import typing as t

codeforlife/settings/django.py

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
This file contains all the settings Django supports out of the box.
3-
https://docs.djangoproject.com/en/3.2/ref/settings/
3+
https://docs.djangoproject.com/en/4.2/ref/settings/
44
"""
55

66
import json
@@ -28,12 +28,12 @@
2828
DEBUG = bool(int(os.getenv("DEBUG", "1")))
2929

3030
# Quick-start development settings - unsuitable for production
31-
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
31+
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
3232

3333
ALLOWED_HOSTS = ["*"]
3434

3535
# Database
36-
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
36+
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
3737

3838

3939
def get_databases():
@@ -106,12 +106,12 @@ def get_databases():
106106
SECRET_KEY = os.getenv("SECRET_KEY", "replace-me")
107107

108108
# Auth
109-
# https://docs.djangoproject.com/en/3.2/topics/auth/default/
109+
# https://docs.djangoproject.com/en/4.2/topics/auth/default/
110110

111111
LOGIN_URL = f"{SERVICE_BASE_URL}/session/expired/"
112112

113113
# Authentication backends
114-
# https://docs.djangoproject.com/en/3.2/ref/settings/#authentication-backends
114+
# https://docs.djangoproject.com/en/4.2/ref/settings/#authentication-backends
115115

116116
AUTHENTICATION_BACKENDS = [
117117
"codeforlife.user.auth.backends.EmailBackend",
@@ -122,7 +122,7 @@ def get_databases():
122122
]
123123

124124
# Sessions
125-
# https://docs.djangoproject.com/en/3.2/topics/http/sessions/
125+
# https://docs.djangoproject.com/en/4.2/topics/http/sessions/
126126

127127
SESSION_ENGINE = "codeforlife.user.models.session"
128128
SESSION_SAVE_EVERY_REQUEST = True
@@ -135,14 +135,14 @@ def get_databases():
135135
SESSION_COOKIE_DOMAIN = os.getenv("SESSION_COOKIE_DOMAIN", "localhost")
136136

137137
# Security
138-
# https://docs.djangoproject.com/en/3.2/topics/security/
138+
# https://docs.djangoproject.com/en/4.2/topics/security/
139139

140140
SECURE_CONTENT_TYPE_NOSNIFF = True
141141
SECURE_BROWSER_XSS_FILTER = True
142142
SECURE_REFERRER_POLICY = "strict-origin-when-cross-origin"
143143

144144
# Internationalization
145-
# https://docs.djangoproject.com/en/3.2/topics/i18n/
145+
# https://docs.djangoproject.com/en/4.2/topics/i18n/
146146

147147
LANGUAGE_CODE = "en-gb"
148148
LANGUAGES = [("en-gb", _("English"))]
@@ -152,12 +152,12 @@ def get_databases():
152152
USE_TZ = True
153153

154154
# Default primary key field type
155-
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
155+
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
156156

157157
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
158158

159159
# CSRF
160-
# https://docs.djangoproject.com/en/3.2/ref/csrf/
160+
# https://docs.djangoproject.com/en/4.2/ref/csrf/
161161

162162
CSRF_COOKIE_NAME = f"{SERVICE_NAME}_csrftoken"
163163
CSRF_COOKIE_DOMAIN = os.getenv("CSRF_COOKIE_DOMAIN", "localhost")
@@ -166,7 +166,7 @@ def get_databases():
166166
CSRF_COOKIE_SECURE = True
167167

168168
# Logging
169-
# https://docs.djangoproject.com/en/3.2/topics/logging/
169+
# https://docs.djangoproject.com/en/4.2/topics/logging/
170170

171171
LOGGING = {
172172
"version": 1,
@@ -194,17 +194,17 @@ def get_databases():
194194
}
195195

196196
# URLs
197-
# https://docs.djangoproject.com/en/3.2/ref/settings/#root-urlconf
197+
# https://docs.djangoproject.com/en/4.2/ref/settings/#root-urlconf
198198

199199
ROOT_URLCONF = "api.urls"
200200

201201
# App
202-
# https://docs.djangoproject.com/en/3.2/ref/settings/#wsgi-application
202+
# https://docs.djangoproject.com/en/4.2/ref/settings/#wsgi-application
203203

204204
WSGI_APPLICATION = "application.app"
205205

206206
# Password validation
207-
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
207+
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
208208

209209
# TODO: compare Django's default common password validator with our own and
210210
# decide which to keep
@@ -232,7 +232,7 @@ def get_databases():
232232
# pylint: enable=line-too-long
233233

234234
# Installed Apps
235-
# https://docs.djangoproject.com/en/3.2/ref/settings/#installed-apps
235+
# https://docs.djangoproject.com/en/4.2/ref/settings/#installed-apps
236236

237237
INSTALLED_APPS = [
238238
"django.contrib.admin",
@@ -255,13 +255,13 @@ def get_databases():
255255
]
256256

257257
# Static files (CSS, JavaScript, Images)
258-
# https://docs.djangoproject.com/en/3.2/howto/static-files/
258+
# https://docs.djangoproject.com/en/4.2/howto/static-files/
259259

260260
STATIC_ROOT = SERVICE_BASE_DIR / "static"
261261
STATIC_URL = os.getenv("STATIC_URL", "/static/")
262262

263263
# Templates
264-
# https://docs.djangoproject.com/en/3.2/ref/templates/
264+
# https://docs.djangoproject.com/en/4.2/ref/templates/
265265

266266
TEMPLATES = [
267267
{
@@ -280,7 +280,7 @@ def get_databases():
280280
]
281281

282282
# File storage
283-
# https://docs.djangoproject.com/en/3.2/topics/files/#file-storage
283+
# https://docs.djangoproject.com/en/4.2/topics/files/#file-storage
284284

285285
DEFAULT_FILE_STORAGE = (
286286
"django.core.files.storage.FileSystemStorage"

codeforlife/urls/handlers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Custom error handlers which override django's default behavior to render a
66
template.
77
8-
https://docs.djangoproject.com/en/3.2/ref/urls/#module-django.conf.urls
8+
https://docs.djangoproject.com/en/4.2/ref/urls/#module-django.conf.urls
99
"""
1010

1111
from django.http import (
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# pylint: skip-file
2-
# TODO: https://docs.djangoproject.com/en/3.2/topics/auth/passwords/#writing-your-own-validator
2+
# TODO: https://docs.djangoproject.com/en/4.2/topics/auth/passwords/#writing-your-own-validator
33
class CommonPasswordValidator:
44
pass

codeforlife/user/models/session.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
class Session(AbstractBaseSession):
1818
"""
1919
A custom session model to support querying a user's session.
20-
https://docs.djangoproject.com/en/3.2/topics/http/sessions/#example
20+
https://docs.djangoproject.com/en/4.2/topics/http/sessions/#example
2121
"""
2222

2323
auth_factors: QuerySet["SessionAuthFactor"]
@@ -35,7 +35,7 @@ class SessionStore(BaseSessionStore[Session, User]):
3535
1. creating only one session per user;
3636
2. setting a session's auth factors;
3737
3. clearing a user's expired sessions.
38-
https://docs.djangoproject.com/en/3.2/topics/http/sessions/#example
38+
https://docs.djangoproject.com/en/4.2/topics/http/sessions/#example
3939
"""
4040

4141
def associate_session_to_user(self, session, user_id):

0 commit comments

Comments
 (0)