Write the get_context_data like this
```
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['second_form'] = self.second_form
return context
```
On Friday, 6 May 2022 at 21:42:07 UTC+5:30 [email protected] wrote:
> Hi I'm trying to put two forms, here is my code:
> ```
> class FrontView(LoginRequiredMixin, UserPassesTestMixin, FormView):
> template_name = "template.html"
> form_class = FirstForm
> coupon_form = SecondForm
>
> def get_context_data(self, **kwargs):
> kwargs['second_form'] = self.second_form
> return super().get_context_data(**kwargs)
> ```
> In the template I used {{ second_form }}. However it's not showing up.
>
> Thanks.
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/1f36d906-99d4-4e90-afb0-659d99e6fa92n%40googlegroups.com.