Code

Ticket #3185: login_url.diff

File login_url.diff, 597 bytes (added by Vasily Sulatskov <redvasily@…>, 7 years ago)
Line 
1Index: django/contrib/auth/__init__.py
2===================================================================
3--- django/contrib/auth/__init__.py     (revision 4235)
4+++ django/contrib/auth/__init__.py     (working copy)
5@@ -1,8 +1,15 @@
6 from django.core.exceptions import ImproperlyConfigured
7 
8+from django.conf import settings
9+
10 SESSION_KEY = '_auth_user_id'
11 BACKEND_SESSION_KEY = '_auth_user_backend'
12-LOGIN_URL = '/accounts/login/'
13+
14+try:
15+    LOGIN_URL = settings.LOGIN_URL
16+except AttributeError:
17+    LOGIN_URL = '/accounts/login/'
18+
19 REDIRECT_FIELD_NAME = 'next'
20 
21 def load_backend(path):