I do not quite understand how to convey the context in the Success template. the user enters the data in the form and you need to display this data in the template. I tried different options: get_queryset , get_context , get_context_data . It is also not clear how to save data to the session. View

 class LoginFormView(FormView): form_class = AuthenticationForm template_name = "blog/login.html" success_url = "/blog" def form_valid(self, form): self.user = form.get_user() login(self.request, self.user) return super(LoginFormView, self).form_valid(form) 

    1 answer 1

    It is also not clear how to save data to the session. View

    self.request.session ['data'] = 123 https://docs.djangoproject.com/en/1.10/topics/http/sessions/#examples

    I do not quite understand how to transfer the context to the Success template.

    when the form data was sent via ajax, I did it like this

      from django.http import JsonResponse def form_valid(request): ... return JsonResponse({'success': True, 'redirect_url': self.get_success_url()})