Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#944 closed enhancement (fixed)

allow app to specify a template for login/logout screens

Reported by: Ian@… Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


probably should make LOGIN_URL & REDIRECT_TO settings in the config.

---    (revision 1474)
+++    (working copy)
@@ -8,7 +8,7 @@
 LOGIN_URL = '/accounts/login/'
-def login(request):
+def login(request, template_name='/registration/login'):
     "Displays the login form and handles the login action."
     manipulator = AuthenticationForm(request)
     redirect_to = request.REQUEST.get(REDIRECT_FIELD_NAME, '')
@@ -24,18 +24,18 @@
         errors = {}
-    return render_to_response('registration/login', {
+    return render_to_response(template_name , {
         'form': formfields.FormWrapper(manipulator, request.POST, errors),
         REDIRECT_FIELD_NAME: redirect_to,
         'site_name': sites.get_current().name,
     }, context_instance=DjangoContext(request))
-def logout(request, next_page=None):
+def logout(request, next_page=None, template_name ='registration/logged_out'):
     "Logs out the user and displays 'You are logged out' message."
         del request.session[users.SESSION_KEY]
     except KeyError:
-        return render_to_response('registration/logged_out', context_instance=DjangoContext(request))
+        return render_to_response(template_name, context_instance=DjangoContext(request))
         # Redirect to this page until the session has been cleared.
         return HttpResponseRedirect(next_page or request.path)

Change History (1)

comment:1 Changed 12 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

This was fixed in [3087].

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