Skip to content

Upgrade Django to 3.2 and update dependencies - #546

Merged
jrhoads merged 6 commits into
devfrom
upgrade-django32
Sep 16, 2026
Merged

jrhoads merged 6 commits into
devfrom
upgrade-django32

Conversation

@jrhoads

@jrhoads jrhoads commented Sep 16, 2026

Copy link
Copy Markdown
Member

Purpose

Upgrade the project dependencies—most notably updating Django from 2.2 to 3.2 (LTS) along with compatible package updates—and modernize configuration, routing, and CI workflow checks.

Approach

  • Upgraded Django from 2.2.28 to 3.2.25 and bumped related dependencies (djangorestframework, django-prometheus, sentry-sdk, django-cors-headers) to versions compatible with Django 3.2.
  • Updated URL patterns in rorapi/common/urls.py to replace deprecated url calls with re_path.
  • Adjusted Django settings to conform with Django 3.2 best practices and modern third-party package conventions (DEFAULT_AUTO_FIELD, CORS_ALLOW_ALL_ORIGINS, AutoSchema compatibility, and removing duplicate middleware).
  • Added system and migration checks (pip check, manage.py check, makemigrations --check --dry-run) to the GitHub Actions test workflow.
  • Cleaned up obsolete Travis CI configuration files.
  • Updated tests in rorapi/v2/tests.py to fix import paths and test client ID validation properly.

Key Modifications

  • Dependency Upgrades (requirements.txt):
    • Django: 2.2.28 -> 3.2.25
    • djangorestframework: 3.11.2 -> 3.12.4
    • django-prometheus: 1.0.15 -> 2.2.0
    • sentry-sdk: 0.12.2 -> 1.45.1
    • django-cors-headers: 3.1.0 -> 3.13.0
  • URL Routing (rorapi/common/urls.py):
    • Migrated legacy django.conf.urls.url references to django.urls.re_path.
  • Project Settings (rorapi/settings.py):
    • Configured DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'.
    • Added 'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema' to maintain compatibility with coreapi schema/documentation generation.
    • Replaced deprecated CORS_ORIGIN_ALLOW_ALL with CORS_ALLOW_ALL_ORIGINS.
    • Removed duplicate django.middleware.common.CommonMiddleware entry in MIDDLEWARE.
    • Removed deprecated USE_L10N = True.
  • CI / Workflows (.github/workflows/run_tests.yml, .travis.yml, .env.travis):
    • Added pip check, python -Wd manage.py check, and python manage.py makemigrations --check --dry-run to workflow steps.
    • Removed .travis.yml and .env.travis.
  • Tests (rorapi/v2/tests.py):
    • Updated model import to from rorapi.v2.models import Client.
    • Replaced rate-limiting test with a test targeting /validate-client-id/<client_id>/.

Important Technical Details

  • Setting REST_FRAMEWORK['DEFAULT_SCHEMA_CLASS'] to rest_framework.schemas.coreapi.AutoSchema ensures that include_docs_urls continues functioning as expected under Django REST Framework 3.12+.
  • Setting DEFAULT_AUTO_FIELD prevents Django 3.2 from generating unwanted implicit auto field migrations across models.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Reviewer, please remember our guidelines:

  • Be humble in the language and feedback you give, ask don't tell.
  • Consider using positive language as opposed to neutral when offering feedback. This is to avoid the negative bias that can occur with neutral language appearing negative.
  • Offer suggestions on how to improve code e.g. simplification or expanding clarity.
  • Ensure you give reasons for the changes you are proposing.

@jrhoads
jrhoads merged commit 9120c71 into dev Sep 16, 2026
2 checks passed
@jrhoads
jrhoads deleted the upgrade-django32 branch September 16, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant