-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Django 5 update (From Django 4) #32406
Conversation
480c8ba
to
a850dc0
Compare
<li> | ||
<form id="logout-form" method="post" action="{% url 'admin:logout' %}"> | ||
{% csrf_token %} | ||
<button type="submit" class="btn btn-link">Logout</button> | ||
</form> | ||
</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI this section most relevant one - you can't GET your logout, so you need to POST and also style that form to look like a link (or at least we choose to do that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This updates the Django tutorial from v4 to v5. It also does some useful stuff like showing how to validate that there can only be one genre with a particular name, case insensitive.
Related demo PRs in mdn/django-locallibrary-tutorial#137 and mdn/django-diy-blog#21
We also need #32336 in
Fixes #31569