Opened 8 years ago

Closed 8 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: UI/UX:


The Django Admin /contrib/admin/ 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 Changed 8 years ago by googol

ADMIN_ LOGIN_REDIRECT_URL would be a solution IMHO. We already have ADMIN_MEDIA_PREFIX for instance

comment:2 Changed 8 years ago by Gabriel Hurley

Resolution: wontfix
Status: newclosed

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!

Note: See TracTickets for help on using tickets.
Back to Top