In my django project, I'd like to add the csrf_token template tag to the base.html template. Just dropping the template tag in doesn't get it populated, I'd have to add it to every view, which is not optimal.
So, is there a way to add the csrf_token on every page?
I would think this would be built into whatever view renders the base.html template.
csrf_token
is necessary within every form for security reasons. As long as you are using only one form in each site the form and the token can reside in yourbase.html
.