chore(deps): upgrade to Django 5.2 LTS and bump Django-coupled dependencies - #963
Merged
Conversation
nimish-ks
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔍 Overview
Django 4.2.30 has reached end-of-life. This PR bumps Django to 5.2 LTS.
5.2 was chosen over 6.x deliberately — it's the next LTS (longest support runway) and our Python 3.12 already meets its 3.10+ floor, whereas 6.0 is a larger jump for a shorter support window (EOL ~April 2027). Skipping 5.0/5.1 is safe here because the codebase uses almost none of the APIs removed along the way (audited; see below).
💡 Proposed Changes
Django + Django-coupled dependency bumps (
backend/requirements.txt):models.NullBooleanFieldat import → crashes on boot under 5.1+rq>=2.6.1floor introduced in 3.2)INSTALLED_APPS, no graphene lazy-filter usageCode fix for a removed API —
django.utils.timezone.utc(removed in Django 5.0) → stdlibdatetime.timezone.utc(aliaseddt_timezone, matching the existing pattern inapi/views/identities/aws/iam.py):backend/backend/schema.py— 4 call sites in the log date-range resolversbackend/api/views/audit.py— 2 call sites in the public audit-log viewNo model, GraphQL schema, or migration changes.
🖼️ Screenshots or Demo
N/A — backend dependency upgrade with no UI or API-contract changes.
📝 Release Notes
❓ Open Questions
django-allauthpin level. Pinned conservatively at 65.7.0 (minimum with 5.2 support, least-breaking). Latest is 65.19.0 and works with the new dj-rest-auth 7.1.1 — but 65.14.2+ stopped trustingX-Forwarded-Forfor rate-limit IP detection, so behind nginx we'd needALLAUTH_TRUSTED_PROXY_COUNTorALLAUTH_TRUSTED_CLIENT_IP_HEADER(e.g.X-Real-IP). Keep the minimal bump, or go latest + add proxy config?datetime.utcnow()inee/integrations/secrets/dynamic/aws/utils.py,unique_together→UniqueConstraintonOrganisationSSOProvider(would add a migration), and the now-unusedpytzpin.🧪 Testing
pytest→ 1087 passed, 1 failed. The single failure (tests/utils/test_secret.py::test_file_read_permission_error) is a pre-existing tests-as-root artifact — the dev container runs asuid=0, and root bypasses thechmod(0o000)the test relies on, so the fallback path never triggers. It is independent of the Django version and does not reproduce when tests run as non-root (e.g. CI).manage.py check: 0 issues — GraphQL schema imports cleanly (noNullBooleanFieldcrash), no Relay-ordering or model problems.migrate --checkexits 0, nothing pending — the existing migration graph loads under 5.2 with no new migrations.runserver) and rqworker both rebuilt and running Django 5.2.17; server responds HTTP 200; worker pool + scheduler start cleanly (0 restarts).check_for_duplicates_blind, the gate behindPOST /secrets/→ 409): verified under 5.2 that same-key/same-path is flagged as a duplicate while a different key, or the same key at a different path, is not (path-scoping intact).🎯 Reviewer Focus
backend/requirements.txt— the version bumps and thedjango-filterremoval.timezone.utc→dt_timezone.utcchange inbackend/backend/schema.pyandbackend/api/views/audit.py(the only code change — confirm the log date-range filters behave identically).➕ Additional Context
graphene-djangoNullBooleanFieldimport crash (a 5.1 removal) and thedjango.utils.timezone.utcremoval (5.0) — both addressed here.✨ How to Test the Changes Locally
Then click through auth (email login + each OAuth provider), the console UI (apps / environments / secrets), and the audit + secret log date-range filters, and trigger a sync — see the PR discussion for the full manual checklist.
💚 Did You...
requirements.txtis the pinned manifest; updatedmigrate --checkclean