Skip to main content
100%

Example of adding Django CSRF token in an page that POSTs using intercooler.

✓ Published0🌍 Public
Aandybak
Last edited Apr 26, 2014
Created on Apr 26, 2014

This example shows how to add a Django CSRF token to pages that send POST requests through intercooler.js, ensuring server-side validation succeeds. It displays a table of rows from a Django template context, each with three action buttons that trigger intercooler’s `ic-post-to` calls to different API endpoints. A hidden form with the `csrfmiddlewaretoken` input, populated via Django’s `{{ csrf_token }}` template variable, is included using the `ic-include` attribute on each button. The intercooler-0.2.0.min.js script is loaded in the scripts block, and the page extends a custom base template.

AI-generated description

Similar vizzes