Skip to content

Commit aed62f8

Browse files
committed
Upgraded to Django 5.1.6 version
1 parent abfdea4 commit aed62f8

12 files changed

+64
-34
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
*.pyo
88
build/
99
dist/
10-
helloworld.db
10+
*.db
11+
*.sqlite3
1112
local_settings.py

README.rst

+14-8
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,28 @@ the following command:
1414

1515
::
1616

17-
$ sudo apt update
17+
$ sudo apt update && sudo apt upgrade
1818

1919
Install necessary minimum dependencies, with the following command:
2020

2121
::
2222

23-
$ sudo apt install python3-dev python3-pip python3-virtualenv sqlitebrowser
23+
$ sudo apt install python3-dev python3-pip python3-virtualenv
2424

2525
For run this example need to install Django framework
2626
executing the follow command:
2727

2828
::
2929

30-
$ sudo pip install -r requirements.txt
30+
$ sudo pip3 install -r requirements.txt
31+
32+
And later to test the Django Installation is done with the following command:
33+
34+
::
35+
36+
$ python -m django --version
37+
5.1.6
3138

32-
And later followed by:
3339

3440
::
3541

@@ -40,9 +46,8 @@ At which point you should see:
4046
::
4147

4248
Operations to perform:
43-
Apply all migrations: admin, auth, contenttypes, sessions, sites
49+
Apply all migrations: admin, auth, contenttypes, sessions
4450
Running migrations:
45-
4651
Applying contenttypes.0001_initial... OK
4752
Applying auth.0001_initial... OK
4853
Applying admin.0001_initial... OK
@@ -57,9 +62,10 @@ At which point you should see:
5762
Applying auth.0007_alter_validators_add_error_messages... OK
5863
Applying auth.0008_alter_user_username_max_length... OK
5964
Applying auth.0009_alter_user_last_name_max_length... OK
65+
Applying auth.0010_alter_group_name_max_length... OK
66+
Applying auth.0011_update_proxy_permissions... OK
67+
Applying auth.0012_alter_user_first_name_max_length... OK
6068
Applying sessions.0001_initial... OK
61-
Applying sites.0001_initial... OK
62-
Applying sites.0002_alter_domain_unique... OK
6369

6470

6571
For use the Django Admin Interface, it's needed to create a superuser
3.46 KB
Loading

docs/django_helloword.png

868 Bytes
Loading

helloworld/asgi.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for helloworld project.
3+
4+
It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.asgi import get_asgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'helloworld.settings')
15+
16+
application = get_asgi_application()

helloworld/settings.py

+23-18
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
"""
22
Django settings for helloworld project.
33
4-
Generated by 'django-admin startproject' using Django 2.2.3.
4+
Generated by 'django-admin startproject' using Django 5.1.6.
55
66
For more information on this file, see
7-
https://docs.djangoproject.com/en/2.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/2.2/ref/settings/
10+
https://docs.djangoproject.com/en/5.1/ref/settings/
1111
"""
1212

13-
import os
13+
from pathlib import Path
1414

15-
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16-
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
15+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
16+
BASE_DIR = Path(__file__).resolve().parent.parent
1717

1818

1919
# Quick-start development settings - unsuitable for production
20-
# See https://docs.djangoproject.com/en/2.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!
23-
SECRET_KEY = 'matxp6k!wbkmdlk)97)ew2qr%&9nr=n#v_-+v#yel4^r&czf7q'
23+
SECRET_KEY = 'django-insecure-sokpy*q9_=6j-9mrh_l)*k+&im(xfbxz_8=&u536n@9s)9&*gv'
2424

2525
# SECURITY WARNING: don't run with debug turned on in production!
2626
DEBUG = True
@@ -72,18 +72,18 @@
7272

7373

7474
# Database
75-
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
75+
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases
7676

7777
DATABASES = {
7878
'default': {
7979
'ENGINE': 'django.db.backends.sqlite3',
80-
'NAME': os.path.join(BASE_DIR, 'helloworld.db'),
80+
'NAME': BASE_DIR / 'helloworld.sqlite3',
8181
}
8282
}
8383

8484

8585
# Password validation
86-
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
86+
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
8787

8888
AUTH_PASSWORD_VALIDATORS = [
8989
{
@@ -102,7 +102,7 @@
102102

103103

104104
# Internationalization
105-
# https://docs.djangoproject.com/en/2.2/topics/i18n/
105+
# https://docs.djangoproject.com/en/5.1/topics/i18n/
106106

107107
LANGUAGE_CODE = 'en-us'
108108

@@ -112,14 +112,19 @@
112112
# to load the internationalization machinery.
113113
USE_I18N = True
114114

115-
# If you set this to False, Django will not format dates, numbers and
116-
# calendars according to the current locale
117-
USE_L10N = True
118-
115+
# If you set this to False, Django will not use timezone-aware datetimes.
119116
USE_TZ = True
120117

121118

122119
# Static files (CSS, JavaScript, Images)
123-
# https://docs.djangoproject.com/en/2.2/howto/static-files/
120+
# https://docs.djangoproject.com/en/5.1/howto/static-files/
121+
122+
STATIC_URL = 'static/'
123+
STATICFILES_DIRS = [
124+
BASE_DIR / "static",
125+
]
126+
127+
# Default primary key field type
128+
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
124129

125-
STATIC_URL = '/static/'
130+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

helloworld/urls.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
"""helloworld URL Configuration
1+
"""
2+
URL configuration for helloworld project.
23
34
The `urlpatterns` list routes URLs to views. For more information please see:
4-
https://docs.djangoproject.com/en/2.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

helloworld/wsgi.py

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

1010
import os

manage.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66

77
def main():
8+
"""Run administrative tasks."""
89
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'helloworld.settings')
910
try:
1011
from django.core.management import execute_from_command_line

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# requirements.txt file
2-
Django==4.2.18
2+
Django==5.1.6

setup.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Indicate supported versions, Python 2, Python 3 or both.
1515
"Programming Language :: Python",
1616
"Programming Language :: Python :: 3",
17-
"Programming Language :: Python :: 3.5",
17+
"Programming Language :: Python :: 3.11",
1818
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
1919
"Topic :: Internet :: WWW/HTTP :: WSGI",
2020
"Topic :: Software Development",
@@ -30,7 +30,7 @@ def read(fname):
3030

3131
setup(
3232
name="django-helloworld",
33-
version="0.1",
33+
version="0.2",
3434
description="A Django 'Hello World' program example",
3535
long_description=read('README.rst'),
3636
classifiers=CLASSIFIERS,
@@ -42,7 +42,7 @@ def read(fname):
4242
url="https://github.com/django-ve/django-helloworld",
4343
license="GPL",
4444
platforms="OS Independent",
45-
install_requires=["Django==4.2.18"],
45+
install_requires=["Django==5.1.6"],
4646
packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES),
4747
include_package_data=True,
4848
zip_safe=False,

static/favicon.ico

2.19 KB
Binary file not shown.

0 commit comments

Comments
 (0)