Skip to content

Commit

Permalink
Upgrade Django to 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronxsu committed Dec 16, 2024
1 parent 32fa005 commit d7b616f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
21 changes: 9 additions & 12 deletions src/django/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
# Note: the Django and psycopg2 versions are repeated in requirements.txt for the benefit
# of the analysis container. The base container and requirements file versions should be kept
# in sync.
FROM quay.io/azavea/django:3.2-python3.10-slim

MAINTAINER Azavea
FROM python:3.10-slim-bullseye

WORKDIR /usr/src
COPY requirements.txt /tmp/

ARG buildDeps=" build-essential libpq-dev"
ARG deps=" gdal-bin libgdal-dev gettext postgresql-client"

RUN apt-get update && apt-get install -y $buildDeps $deps --no-install-recommends
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt
RUN apt-get purge -y --auto-remove $buildDeps

COPY . /usr/src
WORKDIR /usr/src

EXPOSE 9202

CMD ["-w", "1", \
"-b", "0.0.0.0:9202", \
"--reload", \
"--log-level", "info", \
"--error-logfile", "-", \
"--forwarded-allow-ips", "*", \
"-k", "gevent", \
"pfb_network_connectivity.wsgi"]
ENTRYPOINT ["/usr/local/bin/gunicorn"]
16 changes: 16 additions & 0 deletions src/django/gunicorn.conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os

bind = ":9202"
accesslog = "-"
errorlog = "-"
workers = 3
loglevel = "Info"

ENVIRONMENT = os.getenv("DJANGO_ENV", "dev")

if ENVIRONMENT == "dev":
reload = True
else:
preload = True

wsgi_app = "pfb_network_connectivity.wsgi"
8 changes: 5 additions & 3 deletions src/django/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Ideally these should be kept in sync with the versions in the base container
# (https://github.com/azavea/docker-django/blob/master/3.2/requirements.txt) to avoid
# downgrading when building the django container.
Django==3.2.13
Django==4.2.17
psycopg2-binary==2.9.3

boto3==1.23.10
Expand All @@ -16,14 +16,16 @@ django-filter==2.4.0
django-q==1.3.9
django-storages==1.12.3
django-watchman==1.3.0
djangorestframework==3.13.1
djangorestframework==3.15.2
fiona==1.8.21
future==0.18.2
gevent==24.11.1
gunicorn==23.0.0
pycountry==22.3.5
pyuca==1.2
requests==2.27.1
us==2.0.2

# This been removed from application code but was used in old migrations, so it can't be removed
# unless those migrations are refactored to not import it.
django-localflavor==2.2
django-localflavor==4.0

0 comments on commit d7b616f

Please sign in to comment.