Skip to content

Commit 0eab115

Browse files
committed
Django version update
Mostly documentation links and minor changes
1 parent 21c0a2e commit 0eab115

File tree

39 files changed

+193
-125
lines changed

39 files changed

+193
-125
lines changed

django-diary/source_code_final/diary/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/3.2/howto/deployment/asgi/
7+
https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/
88
"""
99

1010
import os

django-diary/source_code_final/diary/settings.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""
22
Django settings for diary project.
33
4-
Generated by 'django-admin startproject' using Django 3.2.1.
4+
Generated by 'django-admin startproject' using Django 5.1.4.
55
66
For more information on this file, see
7-
https://docs.djangoproject.com/en/3.2/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/3.2/ref/settings/
10+
https://docs.djangoproject.com/en/5.1/ref/settings/
1111
"""
1212

1313
from pathlib import Path
@@ -17,11 +17,11 @@
1717

1818

1919
# Quick-start development settings - unsuitable for production
20-
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
20+
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
2121

2222
# SECURITY WARNING: keep the secret key used in production secret!
2323
SECRET_KEY = (
24-
"django-insecure-kom*7k3n4v3gj_mrcp19r_(rl#v^t2v90i_t2dd9&4*4e1nb%+"
24+
"django-insecure-lxfw6(cjvk39um)u-pot#ri79*14rg_c#1nharb)&l10%5jymv"
2525
)
2626

2727
# SECURITY WARNING: don't run with debug turned on in production!
@@ -74,7 +74,7 @@
7474

7575

7676
# Database
77-
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
77+
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases
7878

7979
DATABASES = {
8080
"default": {
@@ -85,7 +85,7 @@
8585

8686

8787
# Password validation
88-
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
88+
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
8989

9090
AUTH_PASSWORD_VALIDATORS = [
9191
{
@@ -104,25 +104,23 @@
104104

105105

106106
# Internationalization
107-
# https://docs.djangoproject.com/en/3.2/topics/i18n/
107+
# https://docs.djangoproject.com/en/5.1/topics/i18n/
108108

109109
LANGUAGE_CODE = "en-us"
110110

111111
TIME_ZONE = "UTC"
112112

113113
USE_I18N = True
114114

115-
USE_L10N = True
116-
117115
USE_TZ = True
118116

119117

120118
# Static files (CSS, JavaScript, Images)
121-
# https://docs.djangoproject.com/en/3.2/howto/static-files/
119+
# https://docs.djangoproject.com/en/5.1/howto/static-files/
122120

123-
STATIC_URL = "/static/"
121+
STATIC_URL = "static/"
124122

125123
# Default primary key field type
126-
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
124+
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
127125

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

django-diary/source_code_final/diary/urls.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1+
"""
2+
URL configuration for diary project.
3+
4+
The `urlpatterns` list routes URLs to views. For more information please see:
5+
https://docs.djangoproject.com/en/5.1/topics/http/urls/
6+
Examples:
7+
Function views
8+
1. Add an import: from my_app import views
9+
2. Add a URL to urlpatterns: path('', views.home, name='home')
10+
Class-based views
11+
1. Add an import: from other_app.views import Home
12+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
13+
Including another URLconf
14+
1. Import the include() function: from django.urls import include, path
15+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
16+
"""
117
from django.contrib import admin
2-
from django.urls import include, path
18+
from django.urls import path, include
319

420
urlpatterns = [
521
path("admin/", admin.site.urls),

django-diary/source_code_final/diary/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/3.2/howto/deployment/wsgi/
7+
https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/
88
"""
99

1010
import os
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from django.contrib import admin
2-
32
from .models import Entry
43

54
admin.site.register(Entry)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

django-diary/source_code_step_1/diary/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/3.2/howto/deployment/asgi/
7+
https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/
88
"""
99

1010
import os

django-diary/source_code_step_1/diary/settings.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""
22
Django settings for diary project.
33
4-
Generated by 'django-admin startproject' using Django 3.2.1.
4+
Generated by 'django-admin startproject' using Django 5.1.4.
55
66
For more information on this file, see
7-
https://docs.djangoproject.com/en/3.2/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/3.2/ref/settings/
10+
https://docs.djangoproject.com/en/5.1/ref/settings/
1111
"""
1212

1313
from pathlib import Path
@@ -17,11 +17,11 @@
1717

1818

1919
# Quick-start development settings - unsuitable for production
20-
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
20+
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
2121

2222
# SECURITY WARNING: keep the secret key used in production secret!
2323
SECRET_KEY = (
24-
"django-insecure-kom*7k3n4v3gj_mrcp19r_(rl#v^t2v90i_t2dd9&4*4e1nb%+"
24+
"django-insecure-lxfw6(cjvk39um)u-pot#ri79*14rg_c#1nharb)&l10%5jymv"
2525
)
2626

2727
# SECURITY WARNING: don't run with debug turned on in production!
@@ -73,7 +73,7 @@
7373

7474

7575
# Database
76-
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
76+
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases
7777

7878
DATABASES = {
7979
"default": {
@@ -84,7 +84,7 @@
8484

8585

8686
# Password validation
87-
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
87+
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
8888

8989
AUTH_PASSWORD_VALIDATORS = [
9090
{
@@ -103,25 +103,23 @@
103103

104104

105105
# Internationalization
106-
# https://docs.djangoproject.com/en/3.2/topics/i18n/
106+
# https://docs.djangoproject.com/en/5.1/topics/i18n/
107107

108108
LANGUAGE_CODE = "en-us"
109109

110110
TIME_ZONE = "UTC"
111111

112112
USE_I18N = True
113113

114-
USE_L10N = True
115-
116114
USE_TZ = True
117115

118116

119117
# Static files (CSS, JavaScript, Images)
120-
# https://docs.djangoproject.com/en/3.2/howto/static-files/
118+
# https://docs.djangoproject.com/en/5.1/howto/static-files/
121119

122-
STATIC_URL = "/static/"
120+
STATIC_URL = "static/"
123121

124122
# Default primary key field type
125-
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
123+
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
126124

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

django-diary/source_code_step_1/diary/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
"""diary URL Configuration
1+
"""
2+
URL configuration for diary project.
23
34
The `urlpatterns` list routes URLs to views. For more information please see:
4-
https://docs.djangoproject.com/en/3.2/topics/http/urls/
5+
https://docs.djangoproject.com/en/5.1/topics/http/urls/
56
Examples:
67
Function views
78
1. Add an import: from my_app import views
@@ -13,7 +14,6 @@
1314
1. Import the include() function: from django.urls import include, path
1415
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1516
"""
16-
1717
from django.contrib import admin
1818
from django.urls import path
1919

django-diary/source_code_step_1/diary/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/3.2/howto/deployment/wsgi/
7+
https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/
88
"""
99

1010
import os

0 commit comments

Comments
 (0)