Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Upgrade Django version to 4.2 LTS #683

Merged
merged 16 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- name: Run Tests
run: docker exec -t analytics_api_testing bash -c "cd /edx/app/analytics_api/analytics_api/
&& export TOXENV=django32 && make test.requirements tox.requirements ${{ matrix.targets }}"
&& export TOXENV=django42 && make test.requirements tox.requirements ${{ matrix.targets }}"

- name: Run Coverage
if: matrix.python-version == '3.8' && matrix.targets=='main.test'
Expand Down
5 changes: 5 additions & 0 deletions analyticsdataserver/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@
USE_TZ = True
########## END GENERAL CONFIGURATION

# Django 4.0+ uses zoneinfo if this is not set. We can remove this and
# migrate to zoneinfo after Django 4.2 upgrade. See more on following url
# https://docs.djangoproject.com/en/4.2/releases/4.0/#zoneinfo-default-timezone-implementation
USE_DEPRECATED_PYTZ = True

########## STATIC FILE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
Expand Down Expand Up @@ -427,6 +431,7 @@
########## EDX ENTERPRISE DATA CONFIGURATION
API_AUTH_TOKEN = 'put-your-api-token-here'
CSRF_COOKIE_SECURE = False
CSRF_TRUSTED_ORIGINS_WITH_SCHEME = [] # just for Django 4.2 upgrade

EXTRA_APPS = []
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
Expand Down
4 changes: 4 additions & 0 deletions analyticsdataserver/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from os import environ

import django
import six
import yaml
# Normally you should not import ANYTHING from Django directly
Expand Down Expand Up @@ -52,3 +53,6 @@ def get_env_setting(setting):

for override, value in DB_OVERRIDES.items():
DATABASES['default'][override] = value

if django.VERSION[0] >= 4: # for greater than django 3.2 use schemes.
CSRF_TRUSTED_ORIGINS = CSRF_TRUSTED_ORIGINS_WITH_SCHEME
21 changes: 11 additions & 10 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@ asgiref==3.7.2
# via
# django
# django-countries
backports-zoneinfo==0.2.1
# via django
boto==2.49.0
# via -r requirements/base.in
boto3==1.28.54
boto3==1.28.61
# via -r requirements/base.in
botocore==1.31.54
botocore==1.31.61
# via
# boto3
# s3transfer
certifi==2023.7.22
# via requests
cffi==1.15.1
cffi==1.16.0
# via
# cryptography
# pynacl
charset-normalizer==3.2.0
charset-normalizer==3.3.0
# via requests
click==8.1.7
# via edx-django-utils
Expand All @@ -34,7 +36,7 @@ cryptography==41.0.4
# via
# django-fernet-fields-v2
# pyjwt
django==3.2.21
django==4.2.6
# via
# -c requirements/constraints.txt
# -r requirements/base.in
Expand Down Expand Up @@ -70,7 +72,7 @@ django-model-utils==4.3.1
# via
# edx-enterprise-data
# edx-rbac
django-storages==1.8
django-storages==1.10.1
# via
# -c requirements/constraints.txt
# -r requirements/base.in
Expand Down Expand Up @@ -151,7 +153,7 @@ newrelic==9.1.0
# via edx-django-utils
ordered-set==4.1.0
# via -r requirements/base.in
packaging==23.1
packaging==23.2
# via drf-yasg
pbr==5.11.1
# via stevedore
Expand All @@ -178,7 +180,6 @@ python-memcached==1.59
# via -r requirements/base.in
pytz==2023.3.post1
# via
# django
# djangorestframework
# drf-yasg
pyyaml==6.0.1
Expand All @@ -194,7 +195,7 @@ requests==2.31.0
# slumber
rules==3.3
# via edx-enterprise-data
s3transfer==0.6.2
s3transfer==0.7.0
# via boto3
semantic-version==2.10.0
# via edx-drf-extensions
Expand Down Expand Up @@ -229,7 +230,7 @@ uritemplate==4.1.1
# via
# coreapi
# drf-yasg
urllib3==1.26.16
urllib3==1.26.17
# via
# -r requirements/base.in
# botocore
Expand Down
5 changes: 3 additions & 2 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
# linking to it here is good.

# TODO: Many pinned dependencies should be unpinned and/or moved to this constraints file.
django<4.0
django<4.3

# django-storages version 1.9 drops support for boto storage backend.
django-storages<1.9 # BSD
# pinning before django upgrade, will unpin after that
django-storages<1.11 # BSD

# elasticsearch library cannot be greater than 7.14.0. 7.14.0 library is not compatible with the 7.10 server in stage and prod
elasticsearch < 7.14.0
Expand Down
21 changes: 11 additions & 10 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@ asgiref==3.7.2
# via
# django
# django-countries
backports-zoneinfo==0.2.1
# via django
boto==2.49.0
# via -r requirements/base.in
boto3==1.28.54
boto3==1.28.61
# via -r requirements/base.in
botocore==1.31.54
botocore==1.31.61
# via
# boto3
# s3transfer
certifi==2023.7.22
# via requests
cffi==1.15.1
cffi==1.16.0
# via
# cryptography
# pynacl
charset-normalizer==3.2.0
charset-normalizer==3.3.0
# via requests
click==8.1.7
# via edx-django-utils
Expand All @@ -34,7 +36,7 @@ cryptography==41.0.4
# via
# django-fernet-fields-v2
# pyjwt
django==3.2.21
django==4.2.6
# via
# -c requirements/constraints.txt
# -r requirements/base.in
Expand Down Expand Up @@ -70,7 +72,7 @@ django-model-utils==4.3.1
# via
# edx-enterprise-data
# edx-rbac
django-storages==1.8
django-storages==1.10.1
# via
# -c requirements/constraints.txt
# -r requirements/base.in
Expand Down Expand Up @@ -153,7 +155,7 @@ newrelic==9.1.0
# via edx-django-utils
ordered-set==4.1.0
# via -r requirements/base.in
packaging==23.1
packaging==23.2
# via drf-yasg
pbr==5.11.1
# via stevedore
Expand All @@ -180,7 +182,6 @@ python-memcached==1.59
# via -r requirements/base.in
pytz==2023.3.post1
# via
# django
# djangorestframework
# drf-yasg
pyyaml==6.0.1
Expand All @@ -196,7 +197,7 @@ requests==2.31.0
# slumber
rules==3.3
# via edx-enterprise-data
s3transfer==0.6.2
s3transfer==0.7.0
# via boto3
semantic-version==2.10.0
# via edx-drf-extensions
Expand Down Expand Up @@ -231,7 +232,7 @@ uritemplate==4.1.1
# via
# coreapi
# drf-yasg
urllib3==1.26.16
urllib3==1.26.17
# via
# -r requirements/base.in
# botocore
Expand Down
2 changes: 1 addition & 1 deletion requirements/django.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
django==3.2.21
django==4.2.6
23 changes: 12 additions & 11 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,29 @@ asgiref==3.7.2
# via
# django
# django-countries
babel==2.12.1
babel==2.13.0
# via
# pydata-sphinx-theme
# sphinx
backports-zoneinfo==0.2.1
# via django
beautifulsoup4==4.12.2
# via pydata-sphinx-theme
boto==2.49.0
# via -r requirements/base.in
boto3==1.28.54
boto3==1.28.61
# via -r requirements/base.in
botocore==1.31.54
botocore==1.31.61
# via
# boto3
# s3transfer
certifi==2023.7.22
# via requests
cffi==1.15.1
cffi==1.16.0
# via
# cryptography
# pynacl
charset-normalizer==3.2.0
charset-normalizer==3.3.0
# via requests
click==8.1.7
# via edx-django-utils
Expand All @@ -44,7 +46,7 @@ cryptography==41.0.4
# via
# django-fernet-fields-v2
# pyjwt
django==3.2.21
django==4.2.6
# via
# -c requirements/constraints.txt
# -r requirements/base.in
Expand Down Expand Up @@ -80,7 +82,7 @@ django-model-utils==4.3.1
# via
# edx-enterprise-data
# edx-rbac
django-storages==1.8
django-storages==1.10.1
# via
# -c requirements/constraints.txt
# -r requirements/base.in
Expand Down Expand Up @@ -171,7 +173,7 @@ newrelic==9.1.0
# via edx-django-utils
ordered-set==4.1.0
# via -r requirements/base.in
packaging==23.1
packaging==23.2
# via
# drf-yasg
# pydata-sphinx-theme
Expand Down Expand Up @@ -211,7 +213,6 @@ python-memcached==1.59
pytz==2023.3.post1
# via
# babel
# django
# djangorestframework
# drf-yasg
pyyaml==6.0.1
Expand All @@ -228,7 +229,7 @@ requests==2.31.0
# sphinx
rules==3.3
# via edx-enterprise-data
s3transfer==0.6.2
s3transfer==0.7.0
# via boto3
semantic-version==2.10.0
# via edx-drf-extensions
Expand Down Expand Up @@ -287,7 +288,7 @@ uritemplate==4.1.1
# via
# coreapi
# drf-yasg
urllib3==1.26.16
urllib3==1.26.17
# via
# -r requirements/base.in
# botocore
Expand Down
2 changes: 1 addition & 1 deletion requirements/pip_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ click==8.1.7
# via pip-tools
importlib-metadata==6.8.0
# via build
packaging==23.1
packaging==23.2
# via build
pip-tools==7.3.0
# via -r requirements/pip_tools.in
Expand Down
Loading
Loading