在Django的1.11 django.conf.global_setting.py
中,它配置了一个常量LOGIN_URL = '/accounts/login/'
##################
# AUTHENTICATION #
##################
LOGIN_URL = '/accounts/login/'
LOGIN_REDIRECT_URL = '/accounts/profile/'
它会重定向到'registration/login.html'
。
class LoginView(SuccessURLAllowedHostsMixin, FormView):
"""
Displays the login form and handles the login action.
"""
form_class = AuthenticationForm
authentication_form = None
redirect_field_name = REDIRECT_FIELD_NAME
template_name = 'registration/login.html'
redirect_authenticated_user = False
extra_context = None
让我感到困惑的是,为什么它被命名为'registration/login.html'
而不是accounts/login.html
?