Fix community login when starting at the /admin/ url
authorMagnus Hagander <magnus@hagander.net>
Sun, 20 Jan 2013 10:01:06 +0000 (11:01 +0100)
committerMagnus Hagander <magnus@hagander.net>
Sun, 20 Jan 2013 10:01:06 +0000 (11:01 +0100)
Previously only worked if you started out at the root, not if you
went directly into the admin pages.

pgmailmgr/mailmgr/templates/admin/login.html [new file with mode: 0644]
pgmailmgr/settings.py

diff --git a/pgmailmgr/mailmgr/templates/admin/login.html b/pgmailmgr/mailmgr/templates/admin/login.html
new file mode 100644 (file)
index 0000000..fb26045
--- /dev/null
@@ -0,0 +1,11 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=/accounts/login/?next=/admin/"></meta>
+</head>
+<body>
+<h1>Redirect</h1>
+<p>
+Redirect <a href="/accounts/login/?next=/admin/">here</a>
+</p>
+</body>
+</html>
index 8e2a129f316d7de81983fcfc727022c72029fa0e..54b6ff79c2b78842d4de00f8e26e31ab06097d59 100644 (file)
@@ -116,11 +116,12 @@ INSTALLED_APPS = (
     'django.contrib.contenttypes',
     'django.contrib.sessions',
     'django.contrib.messages',
+       # Need to load our app before admin, to override template
+       'pgmailmgr.mailmgr',
     # Uncomment the next line to enable the admin:
     'django.contrib.admin',
     # Uncomment the next line to enable admin documentation:
     # 'django.contrib.admindocs',
-       'pgmailmgr.mailmgr',
 )
 
 # A sample logging configuration. The only tangible logging