django-react-boilerplate
django-react-boilerplate copied to clipboard
Add ensure_csrf_cookie just in case
Add ensure_csrf_cookie just in case.
From Django docs:
If your view is not rendering a template containing the csrf_token template tag, Django might not set the CSRF token cookie. This is common in cases where forms are dynamically added to the page. To address this case, Django provides a view decorator which forces setting of the cookie: ensure_csrf_cookie().