Opened 14 years ago
Closed 14 years ago
#14510 closed (wontfix)
Django admin doesn't consider settings.LOGIN_REDIRECT_URL
Reported by: | googol | Owned by: | nobody |
---|---|---|---|
Component: | Contrib apps | Version: | 1.2 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The Django Admin /contrib/admin/sites.py doesn't consider redirect_to nor settings.LOGIN_REDIRECT_URL
def login(self, request):
return http.HttpResponseRedirect(request.get_full_path())
Change History (2)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
This behavior is intentional (to the best of my knowledge and understanding). LOGIN_REDIRECT_URL is meant for redirecting users to a landing page or other such URL in the public-facing portion of your website. It would be extremely frustrating to log in to the Django admin app and have it redirect me to a page elsewhere on the site.
If your use case involves customizing the admin in some way such that you want users to land on a specific admin page after they log in (or to have it be customizable based on some parameter), my inclination is that the best thing to do is to subclass AdminSite and override the login method.
If you feel there is a broad use case for having the admin login function allow redirecting to arbitrary locations, I would suggest starting a thread on the Django Developers mailing list to gain support for it.
Thanks for the report!
ADMIN_ LOGIN_REDIRECT_URL would be a solution IMHO. We already have ADMIN_MEDIA_PREFIX for instance