Skip to content
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.

Commit

Permalink
Allow patching admin login
Browse files Browse the repository at this point in the history
  • Loading branch information
Bouke committed Sep 18, 2012
1 parent 11b615a commit eaa04ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.rst
Expand Up @@ -54,6 +54,9 @@ pages. To do this, configure the ``LOGIN_`` settings:
LOGIN_REDIRECT_URL = '/'
LOGIN_URL = '/federated/login/'

urls.py:
from federated_login import patch_admin

Settings
========

Expand Down
9 changes: 9 additions & 0 deletions federated_login/patch_admin.py
@@ -0,0 +1,9 @@
from django.conf import settings
from django.contrib.admin import sites
from django.views.generic.simple import redirect_to

#monkey-patch admin login
def redirect_admin_login(self, request):
return redirect_to(request, settings.LOGIN_URL)

sites.AdminSite.login = redirect_admin_login

0 comments on commit eaa04ab

Please sign in to comment.