Я хочу отобразить форму в шаблоне класса mydetails, то есть details_detail. html
views.py
class mydetails(generic.DetailView):
model = details
def get_context_data(self, **kwargs):
context = super(ads_detail_vis, self).get_context_data(**kwargs)
context['test'] = Type_details.objects.all()
return context
def formView(request):
if request.method == 'GET':
form = ContactForm()
else:
form = ContactForm(request.POST)
if form.is_valid():
{some code}
return redirect('success')
return render(request, "my_app/form.html", {'form': form})
details_detail. html
<html>
some code context from mydetails class...
{% csrf_token %}
{{ form }}
</html>