Skip to content

Commit 62c9505

Browse files
author
Angelo Dini
committed
Merge branch 'update-django-to-5.1' into 'main'
Update django to 5.1 See merge request divio/templates/getting-started-with-django!4
2 parents eed7835 + 851e5e0 commit 62c9505

File tree

6 files changed

+20
-19
lines changed

6 files changed

+20
-19
lines changed

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ services:
1111
- "./data:/data:rw"
1212
environment:
1313
DATABASE_URL: postgres://postgres@database_default:5432/db
14+
DEBUG: 'True'
1415
links:
1516
- "database_default"
1617
# The following command is used to start the local development server.

mysite/asgi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""
2-
ASGI config.
2+
ASGI config for mysite project.
33
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/5.0/howto/deployment/asgi/
7+
https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/
88
"""
99

1010
import os

mysite/settings.py

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

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

2222

2323
# Quick-start development settings - unsuitable for production
24-
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
24+
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
2525

2626
# SECURITY WARNING: keep the secret key used in production secret!
2727
SECRET_KEY = os.environ.get('SECRET_KEY', 'changeme')
@@ -78,7 +78,7 @@
7878

7979

8080
# Database
81-
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
81+
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases
8282

8383
if "DATABASE_URL" in os.environ:
8484
DATABASES = {'default': dj_database_url.config(conn_max_age=500)}
@@ -92,7 +92,7 @@
9292

9393

9494
# Password validation
95-
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
95+
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
9696

9797
AUTH_PASSWORD_VALIDATORS = [
9898
{
@@ -111,7 +111,7 @@
111111

112112

113113
# Internationalization
114-
# https://docs.djangoproject.com/en/5.0/topics/i18n/
114+
# https://docs.djangoproject.com/en/5.1/topics/i18n/
115115

116116
LANGUAGE_CODE = 'en-us'
117117

@@ -123,7 +123,7 @@
123123

124124

125125
# Static files (CSS, JavaScript, Images)
126-
# https://docs.djangoproject.com/en/5.0/howto/static-files/
126+
# https://docs.djangoproject.com/en/5.1/howto/static-files/
127127

128128
STATIC_URL = '/static/'
129129
STATIC_ROOT = BASE_DIR / 'staticfiles'
@@ -143,7 +143,7 @@
143143

144144

145145
# Default storage settings, with the staticfiles storage updated.
146-
# See https://docs.djangoproject.com/en/5.0/ref/settings/#std-setting-STORAGES
146+
# See https://docs.djangoproject.com/en/5.1/ref/settings/#std-setting-STORAGES
147147
STORAGE_BACKEND = "django.core.files.storage.FileSystemStorage"
148148

149149
if AWS_SECRET_ACCESS_KEY:
@@ -155,14 +155,14 @@
155155
},
156156
# ManifestStaticFilesStorage is recommended in production, to prevent
157157
# outdated JavaScript / CSS assets being served from cache
158-
# See https://docs.djangoproject.com/en/5.0/ref/contrib/staticfiles/#manifeststaticfilesstorage
158+
# See https://docs.djangoproject.com/en/5.1/ref/contrib/staticfiles/#manifeststaticfilesstorage
159159
"staticfiles": {
160160
"BACKEND": "django.contrib.staticfiles.storage.ManifestStaticFilesStorage",
161161
},
162162
}
163163

164164

165165
# Default primary key field type
166-
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
166+
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
167167

168168
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

mysite/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""
2-
URL configuration.
2+
URL configuration for mysite project.
33
44
The `urlpatterns` list routes URLs to views. For more information please see:
5-
https://docs.djangoproject.com/en/5.0/topics/http/urls/
5+
https://docs.djangoproject.com/en/5.1/topics/http/urls/
66
Examples:
77
Function views
88
1. Add an import: from my_app import views

mysite/wsgi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""
2-
WSGI config.
2+
WSGI config for mysite project.
33
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/5.0/howto/deployment/wsgi/
7+
https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/
88
"""
99

1010
import os

requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Django>=4.2,<5.1
1+
Django>=5.1,<5.2
22
dj-database-url==2.2.0
33
psycopg[binary]>=3.1,<3.2
44
gunicorn>=22

0 commit comments

Comments
 (0)