Upgrade to Django 5.2 LTS - #638
Draft
leduythuccs wants to merge 7 commits into
Draft
Conversation
leduythuccs
commented
Jun 19, 2026
Contributor
- upgrade: bump Django to 5.2 and social-auth packages
- docs: update Django version references in settings.py comments
- upgrade: replace unique_together with UniqueConstraint in 11 models
- fix: replace django.utils.timezone.utc removed in Django 5.0
- Django>=4.2,<5 → Django>=5.2,<5.3 (unlock Django 5.2) - social-auth-core==4.3.0 → >=4.5.4 (required by new social-auth-app-django) - social-auth-app-django==5.0.0 → >=5.4.0 (5.0.0 only targeted Django 2.2–4.1; 5.4.0 added official Django 5.x support) Installed: Django 5.2.15, social-auth-core 4.9.1, social-auth-app-django 5.9.0 `python manage.py check` passes with no issues. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace djangoproject.com/en/4.2/ with /en/5.2/ in all six inline documentation URL comments. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Django 4.2 deprecated Meta.unique_together (removal in Django 6.0). Replace with UniqueConstraint in all 11 affected model classes: - judge/models/tag.py: TagData - judge/models/comment.py: CommentVote - judge/models/submission.py: SubmissionTestCase - judge/models/interface.py: BlogVote - judge/models/profile.py: OrganizationMonthlyUsage - judge/models/problem.py: ProblemTranslation, LanguageLimit - judge/models/contest.py: ContestParticipation, ContestProblem, Rating, ContestMoss Migration 0228 removes the unique_together records and adds equivalent UniqueConstraint entries. No schema change — the underlying unique indexes are preserved. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
django.utils.timezone.utc was removed in Django 5.0. Replace all usages with the stdlib datetime.timezone.utc: - judge/models/contest.py: ContestParticipation.pre_registered - judge/views/contests.py: pre-registration sentinel datetime, iCalendar export (now, dtstart, dtend) - judge/views/api/api_v2.py: make_aware fallback for naive timestamps Add `timezone as dt_timezone` to datetime imports in contest.py and contests.py; add `import datetime as dt` in api_v2.py. Refs: Django 5.0 release notes — removed aliases section. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…models" This reverts commit 2663d6b.
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.