Skip to content

Commit a422c58

Browse files
authored
Upgrade to Django 5.0 (#211)
I've also regenerated the scaffold project and ported any changes to it over to the project here (which turned out to only be docs URL changes this time). See: https://www.djangoproject.com/weblog/2023/dec/04/django-50-released/ https://docs.djangoproject.com/en/5.0/releases/5.0/ https://docs.djangoproject.com/en/5.0/howto/upgrade-version/ GUS-W-14616121.
1 parent f72f4f3 commit a422c58

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ web: gunicorn gettingstarted.wsgi
22

33
# Uncomment this `release` process if you are using a database, so that Django's model
44
# migrations are run as part of app deployment, using Heroku's Release Phase feature:
5-
# https://docs.djangoproject.com/en/4.2/topics/migrations/
5+
# https://docs.djangoproject.com/en/5.0/topics/migrations/
66
# https://devcenter.heroku.com/articles/release-phase
77
#release: ./manage.py migrate --no-input

gettingstarted/asgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
It exposes the ASGI callable as a module-level variable named ``application``.
55
66
For more information on this file, see
7-
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
7+
https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/
88
"""
99

1010
import os

gettingstarted/settings.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""
22
Django settings for gettingstarted project.
33
4-
Generated by 'django-admin startproject' using Django 4.2.1.
4+
Generated by 'django-admin startproject' using Django 5.0.
55
66
For more information on this file, see
7-
https://docs.djangoproject.com/en/4.2/topics/settings/
7+
https://docs.djangoproject.com/en/5.0/topics/settings/
88
99
For the full list of settings and their values, see
10-
https://docs.djangoproject.com/en/4.2/ref/settings/
10+
https://docs.djangoproject.com/en/5.0/ref/settings/
1111
"""
1212

1313
import os
@@ -21,15 +21,15 @@
2121

2222

2323
# Before using your Heroku app in production, make sure to review Django's deployment checklist:
24-
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
24+
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
2525

2626
# Django requires a unique secret key for each Django app, that is used by several of its
2727
# security features. To simplify initial setup (without hardcoding the secret in the source
2828
# code) we set this to a random value every time the app starts. However, this will mean many
2929
# Django features break whenever an app restarts (for example, sessions will be logged out).
3030
# In your production Heroku apps you should set the `DJANGO_SECRET_KEY` config var explicitly.
3131
# Make sure to use a long unique value, like you would for a password. See:
32-
# https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-SECRET_KEY
32+
# https://docs.djangoproject.com/en/5.0/ref/settings/#std-setting-SECRET_KEY
3333
# https://devcenter.heroku.com/articles/config-vars
3434
# SECURITY WARNING: keep the secret key used in production secret!
3535
SECRET_KEY = os.environ.get(
@@ -49,7 +49,7 @@
4949
# On Heroku, it's safe to use a wildcard for `ALLOWED_HOSTS``, since the Heroku router performs
5050
# validation of the Host header in the incoming HTTP request. On other platforms you may need
5151
# to list the expected hostnames explicitly to prevent HTTP Host header attacks. See:
52-
# https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-ALLOWED_HOSTS
52+
# https://docs.djangoproject.com/en/5.0/ref/settings/#std-setting-ALLOWED_HOSTS
5353
if IS_HEROKU_APP:
5454
ALLOWED_HOSTS = ["*"]
5555
else:
@@ -62,7 +62,7 @@
6262
# Use WhiteNoise's runserver implementation instead of the Django default, for dev-prod parity.
6363
"whitenoise.runserver_nostatic",
6464
# Uncomment this and the entry in `urls.py` if you wish to use the Django admin feature:
65-
# https://docs.djangoproject.com/en/4.2/ref/contrib/admin/
65+
# https://docs.djangoproject.com/en/5.0/ref/contrib/admin/
6666
# "django.contrib.admin",
6767
"django.contrib.auth",
6868
"django.contrib.contenttypes",
@@ -109,7 +109,7 @@
109109

110110

111111
# Database
112-
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
112+
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
113113

114114
if IS_HEROKU_APP:
115115
# In production on Heroku the database configuration is derived from the `DATABASE_URL`
@@ -136,7 +136,7 @@
136136

137137

138138
# Password validation
139-
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
139+
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
140140

141141
AUTH_PASSWORD_VALIDATORS = [
142142
{
@@ -155,7 +155,7 @@
155155

156156

157157
# Internationalization
158-
# https://docs.djangoproject.com/en/4.2/topics/i18n/
158+
# https://docs.djangoproject.com/en/5.0/topics/i18n/
159159

160160
LANGUAGE_CODE = "en-us"
161161

@@ -167,7 +167,7 @@
167167

168168

169169
# Static files (CSS, JavaScript, Images)
170-
# https://docs.djangoproject.com/en/4.2/howto/static-files/
170+
# https://docs.djangoproject.com/en/5.0/howto/static-files/
171171

172172
STATIC_ROOT = BASE_DIR / "staticfiles"
173173
STATIC_URL = "static/"
@@ -186,6 +186,6 @@
186186

187187

188188
# Default primary key field type
189-
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
189+
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
190190

191191
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

gettingstarted/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
URL configuration for gettingstarted project.
33
44
The `urlpatterns` list routes URLs to views. For more information please see:
5-
https://docs.djangoproject.com/en/4.2/topics/http/urls/
5+
https://docs.djangoproject.com/en/5.0/topics/http/urls/
66
Examples:
77
Function views
88
1. Add an import: from my_app import views
@@ -23,6 +23,6 @@
2323
path("", hello.views.index, name="index"),
2424
path("db/", hello.views.db, name="db"),
2525
# Uncomment this and the entry in `INSTALLED_APPS` if you wish to use the Django admin feature:
26-
# https://docs.djangoproject.com/en/4.2/ref/contrib/admin/
26+
# https://docs.djangoproject.com/en/5.0/ref/contrib/admin/
2727
# path("admin/", admin.site.urls),
2828
]

gettingstarted/wsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
It exposes the WSGI callable as a module-level variable named ``application``.
55
66
For more information on this file, see
7-
https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/
7+
https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/
88
"""
99

1010
import os

hello/migrations/0001_initial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by Django 4.2.1 on 2023-05-18 12:17
1+
# Generated by Django 5.0 on 2023-12-07 15:57
22

33
from django.db import migrations, models
44

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
django>=4.2,<5.0
1+
django>=5.0,<5.1
22
gunicorn>=21.2,<22.0
33
dj-database-url>=2.0,<3.0
44
whitenoise[brotli]>=6.0,<7.0

0 commit comments

Comments
 (0)