Skip to content

Commit ea55871

Browse files
authored
Update example to 4.0.2 (mdn#102)
1 parent 6633500 commit ea55871

9 files changed

Lines changed: 54 additions & 20 deletions

File tree

‎catalog/apps.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33

44
class CatalogConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
56
name = 'catalog'
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Generated by Django 3.2.12 on 2022-02-22 06:23
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('catalog', '0024_auto_20210302_0630'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='author',
15+
name='id',
16+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
17+
),
18+
migrations.AlterField(
19+
model_name='book',
20+
name='id',
21+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
22+
),
23+
migrations.AlterField(
24+
model_name='genre',
25+
name='id',
26+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
27+
),
28+
migrations.AlterField(
29+
model_name='language',
30+
name='id',
31+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
32+
),
33+
]

‎catalog/templates/base_generic.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% block title %}<title>Local Library</title>{% endblock %}
66
<meta charset="utf-8">
77
<meta name="viewport" content="width=device-width, initial-scale=1">
8-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
8+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
99

1010

1111
<!-- Add additional CSS in static file -->

‎catalog/templates/index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h2>UML Models</h2>
1212

1313
<div>
1414
{% load static %}
15-
<img src="{% static "images/local_library_model_uml.png" %}" alt="My image" style="width:555px;height:540px;"/>
15+
<img src="{% static "images/local_library_model_uml.png" %}" alt="My image" width="600px" />
1616
</div>
1717

1818

‎locallibrary/settings.py‎

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

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

1818

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

2222
# SECURITY WARNING: keep the secret key used in production secret!
2323
#SECRET_KEY = 'cg#p$g+j9tax!#a3cup@1$8obt2_+&k3q+pmu)5%asj6yjpkag'
@@ -78,7 +78,7 @@
7878

7979

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

8383
DATABASES = {
8484
'default': {
@@ -89,7 +89,7 @@
8989

9090

9191
# Password validation
92-
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
92+
# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
9393

9494
AUTH_PASSWORD_VALIDATORS = [
9595
{
@@ -108,16 +108,14 @@
108108

109109

110110
# Internationalization
111-
# https://docs.djangoproject.com/en/3.1/topics/i18n/
111+
# https://docs.djangoproject.com/en/4.0/topics/i18n/
112112

113113
LANGUAGE_CODE = 'en-us'
114114

115115
TIME_ZONE = 'UTC'
116116

117117
USE_I18N = True
118118

119-
USE_L10N = True
120-
121119
USE_TZ = True
122120

123121

@@ -138,7 +136,7 @@
138136

139137

140138
# Static files (CSS, JavaScript, Images)
141-
# https://docs.djangoproject.com/en/3.1/howto/static-files/
139+
# https://docs.djangoproject.com/en/4.0/howto/static-files/
142140
# The absolute path to the directory where collectstatic will collect static files for deployment.
143141
STATIC_ROOT = BASE_DIR / 'staticfiles' #. os.path.join(BASE_DIR, 'staticfiles')
144142
# The URL to use when referring to static files (where they will be served from)
@@ -148,3 +146,5 @@
148146
# Static file serving.
149147
# http://whitenoise.evans.io/en/stable/django.html#django-middleware
150148
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
149+
150+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

‎locallibrary/urls.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""locallibrary URL Configuration
22
33
The `urlpatterns` list routes URLs to views. For more information please see:
4-
https://docs.djangoproject.com/en/3.1/topics/http/urls/
4+
https://docs.djangoproject.com/en/4.0/topics/http/urls/
55
Examples:
66
Function views
77
1. Add an import: from my_app import views

‎locallibrary/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.1/howto/deployment/wsgi/
7+
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
88
"""
99

1010
import os

‎requirements.txt‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dj-database-url==0.5.0
2-
Django==3.1.2
3-
gunicorn==20.0.4
4-
psycopg2-binary==2.8.6
5-
wheel==0.35.1
6-
whitenoise==5.2.0
2+
Django==4.0.2
3+
gunicorn==20.1.0
4+
psycopg2-binary==2.9.3
5+
wheel==0.37.1
6+
whitenoise==6.0.0

‎runtime.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
python-3.8.6
1+
python-3.10.2

0 commit comments

Comments
 (0)