url(r'^login/', 'django.contrib.auth.views.login', name='login', kwargs={'template_name': 'admin/login.html', 'extra_context': {'next': '/'}}),
Write this link in the template as follows,
<a href="{% login %}">Login</a>
and when clicked, the login page will appear. After completing the login, you will be redirected to /.
At the time of evaluation, if the URL of the top page is registered, I think it is possible to put the reversed URL in the next argument, but it seems difficult timing-wise, so we directly specify /.
Comments