if request.method == 'POST':
f = AuthenticationForm(request.POST)
if not request.POST.get('remember_me', None):
request.session.set_expiry(0)
else:
request.session.set_expiry(86400)
else:
f = AuthenticationForm(initial={'username': 'Munchen'})
f.username = 'asdasdasd'
# return login(request, authentication_form=AuthForm, *args, **kwargs)
# return login(request, *args, **kwargs)
return render(request, 'registration/login.html', {'form': f})
В итоге функция входа стала такой: