1👍
✅
You would have to go to a class based view, as such:
class MyView(View):
def get(self, request):
my_form = Formname()
return render(request, 'template.html', {'my_form': my_form})
def post(self, request):
my_form = Formname(request.POST)
if my_form.is_valid():
result = do_stuff()
return render(request, 'template.html', {'my_form': my_form, 'result': result})
return render(request, 'template.html', {'my_form': my_form})
0👍
Create a new view where the user submits the form from the template and render the same template from that view including the submitted data.
- CSRF token missing or incorrect. Django 1.8 restaurant app
- Puppet Dependency file failing in local Vagrant Environmnet
- Django verify HttpResponse reached user
- Count visitors on your site with django
Source:stackexchange.com