[Answered ]-Django using arguments in form action with CSRF token

2👍

Your code is failing at

return HttpResponseRedirect('/contact/{{ contact_id }}/')

You are trying to use template syntax here, rather you should do

return HttpResponseRedirect('/contact/'+str(contact_id))

Apart from that your code will not handle case when form is not valid and will call same code. You may want to show the form again with errors when form is not valid. Refer form handling docs from django.

👤Rohan

Leave a comment