Python - render with csrf protection
I've read several posts about csrf protection in Django, including Django's documentation , but I'm still quite confused in how to use it correctly. The clearest part is the HTML one, but the Python's one is kinda confusing. HTML {% csrf_token %} inside the form Python c = {} c.update(csrf(request)) You need it in every form when displaying and requesting the information, don't you? Then, how do you include this csrf protection in the return render() ? Is this correct? return render(request,'index.html',{'var':var_value}) or should I include the c somewhere like in the Python documentation