Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add official support for Django 5.1#9514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
auvipy merged 11 commits intoencode:masterfrombrowniebroke:update/django-5.1
Sep 7, 2024

Conversation

browniebroke
Copy link
Member

@browniebrokebrowniebroke commentedAug 29, 2024
edited
Loading

Description

Add Django 5.1 to the CI matrixfollowing the supported Python versions and declare official support.

TGoddessana reacted with thumbs up emojiulgens and IhateTrains reacted with rocket emoji
Comment on lines -45 to -49
[testenv:py38-djangomain]
ignore_outcome = true

[testenv:py39-djangomain]
ignore_outcome = true
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

We don't test Django main against 3.8 or 3.9 so this is unused

Copy link
Member

Choose a reason for hiding this comment

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

right

@browniebroke
Copy link
MemberAuthor

Should we try to fix the issue with the newLoginRequiredMiddleware as part of this PR?#9503

@auvipy
Copy link
Member

Should we try to fix the issue with the newLoginRequiredMiddleware as part of this PR?#9503

I think we should include that in this PR

browniebroke reacted with thumbs up emoji

@browniebrokebrowniebroke marked this pull request as draftAugust 30, 2024 09:08
@browniebrokebrowniebroke marked this pull request as ready for reviewAugust 30, 2024 17:57
@browniebroke
Copy link
MemberAuthor

browniebroke commentedAug 30, 2024
edited
Loading

I initially went with a customLoginRequiredMiddleware but then realised that authentication status of a request in DRF isn't easy to figure out at the middleware level. This is because it's a combination ofauthentication_classes +permission_classes settings, which may come from the view or the global settings.

Additionally, I struggled a bit to test that solution as I couldn't find out a way to configure test views with a non-defaultDEFAULT_PERMISSION_CLASSES, and I always ended up withAllowAny in my views. I was aiming for integration style of tests: configuring a view, with URLs and setting up the whole middleware chain. I left the commit if someone is interested...

I took a step back and realised that DRF already offered a way to achieve whatLoginRequiredMiddleware does, via its settings. So I ended marking DRF views as opted-out from Django's middleware, and documenting how to achieve the same thing with API views.

What do people think of the approach?

@RobKuipers
Copy link

Very nice solution. I feelLoginRequiredMiddleware is intended for 'normal' Django views, not for API calls.
Thank you very much for making this change.

@browniebroke
Copy link
MemberAuthor

Added some more integration-like type of tests to make sure every type of views are covered: class based views, function based views, viewsets and viewsets actions.

@auvipyauvipy merged commit2ede857 intoencode:masterSep 7, 2024
7 checks passed
@browniebrokebrowniebroke deleted the update/django-5.1 branchSeptember 7, 2024 16:02
@cjwatson
Copy link

Is there a plan to make a new release to PyPI soon with this change? Debian is currently in the process of switching to Python 3.13 by default, which either requires Django 5.1 or some backporting of patches. I'm wondering whether it makes more sense to attempt to backport this patch to REST framework 3.15.2, or something else.

ulgens reacted with heart emoji

@browniebrokebrowniebroke added this to the3.16 milestoneJan 16, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ulgensulgensulgens approved these changes

@auvipyauvipyauvipy approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
3.16
Development

Successfully merging this pull request may close these issues.

5 participants
@browniebroke@auvipy@RobKuipers@cjwatson@ulgens

[8]ページ先頭

©2009-2025 Movatter.jp