Skip to content

Commit c8ecfc1

Browse files
Update fixtures and update default python version to 3.10.x
Co-authored-by: Brayan Henao <[email protected]>
1 parent 624fcf5 commit c8ecfc1

57 files changed

Lines changed: 92 additions & 70 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for django_web_app 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/4.0/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', 'django_web_app.settings')
15+
16+
application = get_asgi_application()

fixtures/django_python_3/django_web_app/settings.py

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
"""
22
Django settings for django_web_app project.
33
4-
Generated by 'django-admin startproject' using Django 1.9.7.
4+
Generated by 'django-admin startproject' using Django 4.0.
55
66
For more information on this file, see
7-
https://docs.djangoproject.com/en/1.9/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/1.9/ref/settings/
10+
https://docs.djangoproject.com/en/4.0/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/1.9/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!
23-
SECRET_KEY = '6ky7k!%v9u#p!m%))=zn2(qc&=12y72)^nd%#pu@$wuvzk3p0$'
23+
SECRET_KEY = 'django-insecure-2#sh(s&7s!oy^y3hti86)slp=67hivo12la+hhly%kag$!e!c!'
2424

2525
# SECURITY WARNING: don't run with debug turned on in production!
2626
DEBUG = True
2727

28-
ALLOWED_HOSTS = []
28+
ALLOWED_HOSTS = ['*']
2929

3030

3131
# Application definition
@@ -39,13 +39,13 @@
3939
'django.contrib.staticfiles',
4040
]
4141

42-
MIDDLEWARE_CLASSES = [
42+
MIDDLEWARE = [
4343
'django.middleware.security.SecurityMiddleware',
44+
'whitenoise.middleware.WhiteNoiseMiddleware',
4445
'django.contrib.sessions.middleware.SessionMiddleware',
4546
'django.middleware.common.CommonMiddleware',
4647
'django.middleware.csrf.CsrfViewMiddleware',
4748
'django.contrib.auth.middleware.AuthenticationMiddleware',
48-
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
4949
'django.contrib.messages.middleware.MessageMiddleware',
5050
'django.middleware.clickjacking.XFrameOptionsMiddleware',
5151
]
@@ -72,18 +72,18 @@
7272

7373

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

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

8484

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

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

103103

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

107107
LANGUAGE_CODE = 'en-us'
108108

109109
TIME_ZONE = 'UTC'
110110

111111
USE_I18N = True
112112

113-
USE_L10N = True
114-
115113
USE_TZ = True
116114

117-
118-
# Static files (CSS, JavaScript, Images)
119-
# https://docs.djangoproject.com/en/1.9/howto/static-files/
120-
121115
STATIC_URL = '/static/'
122116
STATIC_ROOT = 'static_root'
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
"""django_web_app URL Configuration
22
33
The `urlpatterns` list routes URLs to views. For more information please see:
4-
https://docs.djangoproject.com/en/1.9/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
8-
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
8+
2. Add a URL to urlpatterns: path('', views.home, name='home')
99
Class-based views
1010
1. Add an import: from other_app.views import Home
11-
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
11+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
1212
Including another URLconf
13-
1. Import the include() function: from django.conf.urls import url, include
14-
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
13+
1. Import the include() function: from django.urls import include, path
14+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1515
"""
16-
from django.conf.urls import url
1716
from django.contrib import admin
17+
from django.urls import path
1818

1919
urlpatterns = [
20-
url(r'^admin/', admin.site.urls),
20+
path('admin/', admin.site.urls),
2121
]

fixtures/django_python_3/django_web_app/wsgi.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
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/1.9/howto/deployment/wsgi/
7+
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
88
"""
99

1010
import os
1111

1212
from django.core.wsgi import get_wsgi_application
13-
from whitenoise.django import DjangoWhiteNoise
1413

15-
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_web_app.settings")
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_web_app.settings')
1615

1716
application = get_wsgi_application()
18-
application = DjangoWhiteNoise(application)

fixtures/django_python_3/manage.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
#!/usr/bin/env python
2+
"""Django's command-line utility for administrative tasks."""
23
import os
34
import sys
45

5-
if __name__ == "__main__":
6-
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_web_app.settings")
7-
8-
from django.core.management import execute_from_command_line
96

7+
def main():
8+
"""Run administrative tasks."""
9+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_web_app.settings')
10+
try:
11+
from django.core.management import execute_from_command_line
12+
except ImportError as exc:
13+
raise ImportError(
14+
"Couldn't import Django. Are you sure it's installed and "
15+
"available on your PYTHONPATH environment variable? Did you "
16+
"forget to activate a virtual environment?"
17+
) from exc
1018
execute_from_command_line(sys.argv)
19+
20+
21+
if __name__ == '__main__':
22+
main()
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
dj-database-url==0.4.1
2-
Django==1.9.7
3-
gunicorn==19.6.0
4-
waitress==0.9.0
5-
whitenoise==3.2
1+
dj-database-url==0.5.0
2+
Django>=4.0
3+
gunicorn==20.1.0
4+
waitress==2.0.0
5+
whitenoise==5.3.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
python-3.6.x
1+
python-3.9.x

fixtures/flask/requirements.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Flask==0.10.1
2-
Jinja2==2.7.2
3-
MarkupSafe==0.21
4-
Werkzeug==0.10.4
5-
gunicorn==19.3.0
6-
itsdangerous==0.24
7-
pylibmc==1.4.2
8-
cffi==0.9.2
1+
Flask
2+
Jinja2
3+
MarkupSafe
4+
Werkzeug
5+
gunicorn
6+
itsdangerous
7+
pylibmc
8+
cffi
-531 KB
Binary file not shown.
93 KB
Binary file not shown.

0 commit comments

Comments
 (0)