The django docs tell us that our AJAX scripts should acquire the token from the designated cookie as in get_cookie('_csrf_token')
. Can I rather print it to the HTML source, so that it's available to the JS context more easily?
<script>
var TOKEN = "{{csrf_token}}";
</script>
<script src="myscript.js">