Django form data lost on making login required on post
问题 In my app, I want the following behaviour: User goes to contact form url User fills up the contact form (a) If user is logged in, validate and submit the form (b) If user is not logged in, redirect to login form for logging in and then if users credentials are validated, submit the form. In my views.py , I have: @method_decorator(login_required, name='post') class ContactView(FormView): template_name = 'extras/contact.html' form_class = ContactForm def post(self, request, *args, **kwargs):