<div style='display:none'><input type='hidden' name='csrfmiddlewaretoken' value='6bda3605af31dd8595d2a67d0dda827b' /></div>As the developer, I should have complete control over what HTML is being sent to the browser. After some tinkering around, I came up with this method of stripping it down to only the token.
{% with csrf_token as csrf_token_clean %}{{ csrf_token_clean }}{% endwith %}Here is an example of how I used it.<input type="hidden" name="csrfmiddlewaretoken" value="{% with csrf_token as csrf_token_clean %}{{ csrf_token_clean }}{% endwith %}" />I was expecting to use the |cut filter to strip off the generated HTML, but I didn't need to. Enjoy!
