Skip to content

Upgrade django to 5.2#3133

Open
annagav wants to merge 2 commits intomainfrom
ag/django_5_2
Open

Upgrade django to 5.2#3133
annagav wants to merge 2 commits intomainfrom
ag/django_5_2

Conversation

@annagav
Copy link
Copy Markdown
Contributor

@annagav annagav commented Dec 5, 2025

What are the relevant tickets?

Fix https://github.com/mitodl/hq/issues/8953

Description (What does it do?)

  • Updating django 5.2

How can this be tested?

everything should work as expected

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 5, 2025

OpenAPI Changes

Show/hide ## Changes for v0.yaml:
## Changes for v0.yaml:
No changes detected

## Changes for v1.yaml:
No changes detected

## Changes for v2.yaml:
No changes detected

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

@annagav annagav marked this pull request as ready for review December 10, 2025 17:26
@annagav annagav force-pushed the ag/django_5_2 branch 2 times, most recently from 4fcf3a7 to 2c748f8 Compare December 12, 2025 20:44
@annagav annagav force-pushed the ag/django_5_2 branch 6 times, most recently from a9c3d00 to 376898b Compare February 27, 2026 15:43
@annagav annagav force-pushed the ag/django_5_2 branch 2 times, most recently from d9b4789 to 35cd8b1 Compare May 1, 2026 16:19
Copy link
Copy Markdown
Collaborator

@rhysyngsun rhysyngsun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review, will test shortly.

Comment thread courses/models.py
CheckConstraint(
name="courses_programrequirement_node_check",
check=(
condition=(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 2 migrations - 0022 and 0063 that are still using check=

Comment thread pyproject.toml
"deepdiff>=8.0.0,<9",
"dj-database-url>=0.5.0,<0.6",
"django==5.1.15",
"django==5.2",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think going forward it might be better to have this be defined as a constraint within a minor version, so django>=5.2,<5.3. That way whenever a new patch comes down only the lockfile needs to be updated.

Copy link
Copy Markdown
Contributor

@Anas12091101 Anas12091101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started reviewing this, but I see Nathan has already provided feedback and is testing it. I just have one small question; otherwise, I’ll leave the rest to him:

Comment thread main/middleware.py
Comment on lines +27 to +30
async def aprocess_request(self, request):
# Call the sync version for compatibility
return self.process_request(request)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this method added, and how is it expected to be invoked? I don’t think aprocess_request is a recognized hook in Django middleware.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I agree, I think it's something specific to RemoteUserMiddleware , it looks like MiddlewareMixin just calls sync_to_async on process_request() anyway: https://github.com/django/django/blob/stable/5.2.x/django/utils/deprecation.py#L125-L142

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants