=== modified file 'django/contrib/auth/__init__.py'
|
|
|
| 1 | from django.conf import settings |
1 | 2 | from django.core.exceptions import ImproperlyConfigured |
2 | 3 | |
3 | 4 | SESSION_KEY = '_auth_user_id' |
4 | 5 | BACKEND_SESSION_KEY = '_auth_user_backend' |
5 | | LOGIN_URL = '/accounts/login/' |
| 6 | LOGIN_URL = getattr(settings, 'LOGIN_URL', '/accounts/login/') |
| 7 | ACCOUNT_URL = getattr(settings, 'ACCOUNT_URL', '/accounts/profile/') |
6 | 8 | REDIRECT_FIELD_NAME = 'next' |
7 | 9 | |
8 | 10 | def load_backend(path): |
=== modified file 'django/contrib/auth/views.py'
|
|
|
6 | 6 | from django.contrib.sites.models import Site |
7 | 7 | from django.http import HttpResponseRedirect |
8 | 8 | from django.contrib.auth.decorators import login_required |
9 | | from django.contrib.auth import LOGIN_URL, REDIRECT_FIELD_NAME |
| 9 | from django.contrib.auth import LOGIN_URL, ACCOUNT_URL, REDIRECT_FIELD_NAME |
10 | 10 | |
11 | 11 | def login(request, template_name='registration/login.html'): |
12 | 12 | "Displays the login form and handles the login action." |
… |
… |
|
17 | 17 | if not errors: |
18 | 18 | # Light security check -- make sure redirect_to isn't garbage. |
19 | 19 | if not redirect_to or '://' in redirect_to or ' ' in redirect_to: |
20 | | redirect_to = '/accounts/profile/' |
| 20 | redirect_to = ACCOUNT_URL |
21 | 21 | from django.contrib.auth import login |
22 | 22 | login(request, manipulator.get_user()) |
23 | 23 | request.session.delete_test_cookie() |