要实现这样的需求其实很简单:
@login_required
LOGIN_URL
python3 manage.py createsuperuser
登录后默认跳转到 /accounts/profile/
/accounts/profile/
可以在settings.py中进行设置
LOGIN_REDIRECT_URL = '/'
<form class="form-signin" action="/accounts/login/" method="post">{% csrf_token %} ... </form>