Skip to content

Commit fd81ad0

Browse files
committed
Upgrade Django to 4.2.5 and postgres:16
1 parent 5ffacfd commit fd81ad0

File tree

13 files changed

+47
-52
lines changed

13 files changed

+47
-52
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# docker build --build-arg http_proxy=${PROXY} --build-arg ENVIRONMENT=local -t local/chris_store:dev .
3131
#
3232

33-
FROM fnndsc/ubuntu-python3:ubuntu20.04-python3.8.5
33+
FROM fnndsc/ubuntu-python3:ubuntu20.04-python3.8.10
3434
MAINTAINER fnndsc "[email protected]"
3535

3636
# Pass a UID on build command line (see above) to set internal UID

docker-compose_dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ services:
3434
role: "Development server"
3535

3636
chris_store_dev_db:
37-
image: postgres:13
37+
image: postgres:16
3838
volumes:
3939
- chris_store_dev_db_data:/var/lib/postgresql/data
4040
environment:

make.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ if [[ "$1" == 'up' ]]; then
4242

4343
title -d 1 "Pulling core containers where needed..."
4444
printf "${LightCyan}%40s${Green}%-40s${Yellow}\n" \
45-
"docker pull" " postgres:13" | ./boxes.sh
46-
docker pull postgres:13 | ./boxes.sh
45+
"docker pull" " postgres:16" | ./boxes.sh
46+
docker pull postgres:16 | ./boxes.sh
4747
echo "" | ./boxes.sh
4848
windowBottom
4949

requirements/base.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Django==4.0
2-
django-filter==22.1
3-
djangorestframework==3.13.1
4-
django-cors-headers==3.13.0
5-
psycopg2==2.9.3
6-
mod-wsgi==4.9.3
1+
Django==4.2.5
2+
django-filter==23.3
3+
djangorestframework==3.14.0
4+
django-cors-headers==4.2.0
5+
psycopg[binary,pool]
6+
mod-wsgi==4.9.4
77
environs==9.5.0
88
six==1.16.0

requirements/local.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Local development dependencies go here
22
-r base.txt
3-
django-debug-toolbar==3.6.0
4-
django-extensions==3.2.0
3+
django-debug-toolbar==4.2.0
4+
django-extensions==3.2.3
55
collection-json==0.1.1
6-
coverage==6.4.4
7-
pylint==2.15.0
8-
flake8==5.0.4
9-
isort==5.10.1
6+
coverage==7.3.1
7+
pylint==2.17.5
8+
flake8==6.1.0
9+
isort==5.12.0

store_backend/config/asgi.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""
2-
ASGI config for mysite project.
2+
ASGI config for store_backend 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/4.0/howto/deployment/asgi/
7+
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
88
"""
99

1010
import os, sys

store_backend/config/settings/common.py

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
Django settings for mysite project.
3+
Django settings for store_backend project.
44
5-
Generated by 'django-admin startproject' using Django 4.0.
5+
Generated by 'django-admin startproject' using Django 4.2.5.
66
77
For more information on this file, see
8-
https://docs.djangoproject.com/en/4.0/topics/settings/
8+
https://docs.djangoproject.com/en/4.2/topics/settings/
99
1010
For the full list of settings and their values, see
11-
https://docs.djangoproject.com/en/4.0/ref/settings/
11+
https://docs.djangoproject.com/en/4.2/ref/settings/
1212
"""
1313

1414
from pathlib import Path
@@ -95,7 +95,7 @@
9595

9696

9797
# Database
98-
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
98+
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
9999

100100
DATABASES = {
101101
'default': {
@@ -105,7 +105,7 @@
105105

106106

107107
# Password validation
108-
# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
108+
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
109109

110110
AUTH_PASSWORD_VALIDATORS = [
111111
{
@@ -124,26 +124,23 @@
124124

125125

126126
# Internationalization
127-
# https://docs.djangoproject.com/en/4.0/topics/i18n/
127+
# https://docs.djangoproject.com/en/4.2/topics/i18n/
128128

129129
LANGUAGE_CODE = 'en-us'
130130

131131
TIME_ZONE = 'America/New_York'
132132

133133
USE_I18N = True
134134

135-
USE_L10N = True
136-
137135
USE_TZ = True
138136

139137

140138
# Static files (CSS, JavaScript, Images)
141-
# https://docs.djangoproject.com/en/4.0/howto/static-files/
142-
143-
STATIC_URL = '/static/'
139+
# https://docs.djangoproject.com/en/4.2/howto/static-files/
144140

141+
STATIC_URL = 'static/'
145142

146143
# Default primary key field type
147-
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
144+
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
148145

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

store_backend/config/settings/local.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,19 @@
1111
from .common import * # noqa
1212

1313
# Quick-start development settings - unsuitable for production
14-
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
14+
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
1515

1616
# SECURITY WARNING: keep the secret key used in production secret!
17-
SECRET_KEY = 'w1kxu^l=@pnsf!5piqz6!!5kdcdpo79y6jebbp+2244yjm*#+k'
18-
19-
# Hosts/domain names that are valid for this site
20-
# See https://docs.djangoproject.com/en/4.0/ref/settings/#allowed-hosts
21-
ALLOWED_HOSTS = ['*']
17+
SECRET_KEY = 'django-insecure-tvtw1#&s4i9pxosr^2rnwdh0o1-ka-l+u6(@t+c)#864((*3$4'
2218

2319
# SECURITY WARNING: don't run with debug turned on in production!
2420
DEBUG = True
2521

22+
# See https://docs.djangoproject.com/en/4.2/ref/settings/#allowed-hosts
23+
ALLOWED_HOSTS = ['*']
24+
2625
# LOGGING CONFIGURATION
27-
# See https://docs.djangoproject.com/en/4.0/topics/logging/ for
26+
# See https://docs.djangoproject.com/en/4.2/topics/logging/ for
2827
# more details on how to customize your logging configuration.
2928
LOGGING = {
3029
'version': 1,
@@ -68,7 +67,7 @@
6867

6968

7069
# Database
71-
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
70+
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
7271
DATABASES['default']['NAME'] = 'chris_store_dev'
7372
DATABASES['default']['USER'] = 'chris'
7473
DATABASES['default']['PASSWORD'] = 'Chris1234'

store_backend/config/settings/production.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,20 @@ def get_secret(setting, secret_type=env):
2727

2828
# SECRET CONFIGURATION
2929
# ------------------------------------------------------------------------------
30-
# See: https://docs.djangoproject.com/en/4.0/ref/settings/#secret-key
31-
# Raises ImproperlyConfigured exception if DJANGO_SECRET_KEY not in os.environ
30+
# See: https://docs.djangoproject.com/en/4.2/ref/settings/#secret-key
3231
SECRET_KEY = get_secret('DJANGO_SECRET_KEY')
3332

3433

3534
# SITE CONFIGURATION
3635
# ------------------------------------------------------------------------------
3736
# Hosts/domain names that are valid for this site
38-
# See https://docs.djangoproject.com/en/4.0/ref/settings/#allowed-hosts
37+
# See https://docs.djangoproject.com/en/4.2/ref/settings/#allowed-hosts
3938
ALLOWED_HOSTS = get_secret('DJANGO_ALLOWED_HOSTS', env.list)
4039
# END SITE CONFIGURATION
4140

4241

4342
# DATABASE CONFIGURATION
4443
# ------------------------------------------------------------------------------
45-
# Raises ImproperlyConfigured exception if DATABASE_URL not in os.environ
4644
DATABASES['default']['NAME'] = get_secret('POSTGRES_DB')
4745
DATABASES['default']['USER'] = get_secret('POSTGRES_USER')
4846
DATABASES['default']['PASSWORD'] = get_secret('POSTGRES_PASSWORD')
@@ -51,7 +49,7 @@ def get_secret(setting, secret_type=env):
5149

5250

5351
# LOGGING CONFIGURATION
54-
# See https://docs.djangoproject.com/en/4.0/topics/logging/ for
52+
# See https://docs.djangoproject.com/en/4.2/topics/logging/ for
5553
# more details on how to customize your logging configuration.
5654
ADMINS = [('FNNDSC Developers', '[email protected]')]
5755
LOGGING = {

store_backend/config/urls.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
"""mysite URL Configuration
1+
"""
2+
URL configuration for store_backend project.
23
34
The `urlpatterns` list routes URLs to views. For more information please see:
4-
https://docs.djangoproject.com/en/4.0/topics/http/urls/
5+
https://docs.djangoproject.com/en/4.2/topics/http/urls/
56
Examples:
67
Function views
78
1. Add an import: from my_app import views

store_backend/config/wsgi.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""
2-
WSGI config for mysite project.
2+
WSGI config for store_backend 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/4.0/howto/deployment/wsgi/
7+
https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/
88
"""
99

1010
import os, sys

store_backend/migratedb.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import time
44
import sys
5-
import psycopg2
5+
import psycopg
66
from argparse import ArgumentParser
77

88
# django needs to be loaded
@@ -31,8 +31,8 @@
3131
db = None
3232
while max_tries > 0 and db is None:
3333
try:
34-
db = psycopg2.connect(host=host, user=args.user, password=args.password,
35-
dbname=args.database)
34+
db = psycopg.connect(host=host, user=args.user, password=args.password,
35+
dbname=args.database)
3636
except Exception:
3737
time.sleep(5)
3838
max_tries -= 1

swarm/prod/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ services:
3131
role: "Production server using Apache's mod_wsgi"
3232

3333
chris_store_db:
34-
image: postgres:13
34+
image: postgres:16
3535
volumes:
3636
- chris_store_db_data:/var/lib/postgresql/data
3737
env_file:

0 commit comments

Comments
 (0)