I have made a form where i wish to return to the same form again, this time with context data that can be used in my template to show that the form has been successfully sent.
How can i do this?
class ContactUsView(FormView):
form_class = ContactUsForm
template_name = 'website/pages/contact_us.html'
def form_valid(self, form):
form.send_email()
return super(ContactUsView, self).form_valid(form)
def get_success_url(self):
# Something here?
So basically i want get_success_url
to return to the ContactUsView
with e.g. {'success':'true'}
which i can read in the template and render a box that says it has been successfull. I dont want to change to another static page!