-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
docs: Change admin site workaround documentation #3809
Conversation
The documented workaround was resulting in ERR_TOO_MANY_REDIRECTS. To solve this issue a workaround using a custom decorator was proposed.
IMO protecting the admin is really important, so I think it would make sense to promote that code to an actual decorator that just works out of the box, so that people do not need to copy chunks of code around. How about we add that decorator to |
Sounds great to me! |
If I use this decorator, while logged in as a regular user, and then visit an admin page, I am redirected to |
Also, perhaps nitpicking, but the name
|
While I was toying with this anyway, I figured I could just as well file a PR right away. Could you take #3818 for a test spin? |
I think both approaches are valid. Sometimes a webmaster may not want to raise 403 or show 403 page to users but instead redirect them to the default login success page. I've seen some webpages doing this. In terms of customizability this looks more flexible. How about adding an optional argument, something like |
The Django admin also uses |
The documented workaround was resulting in ERR_TOO_MANY_REDIRECTS. To solve this issue a workaround using a custom decorator was proposed.
Fixes #3786
Submitting Pull Requests
General
Examples:
"fix(google): Fixed foobar bug"
,"feat(accounts): Added foobar feature"
.ChangeLog.rst
.AUTHORS
.