Skip to content

Added the boilerplate code from the django docs to allow this to pick up...#73

Open
tomoconnor wants to merge 1 commit intoeldarion:masterfrom
tomoconnor:django_csrf
Open

Added the boilerplate code from the django docs to allow this to pick up...#73
tomoconnor wants to merge 1 commit intoeldarion:masterfrom
tomoconnor:django_csrf

Conversation

@tomoconnor
Copy link

... a csrf token for django integration.

I noticed when using this with https://github.com/pinax/phileo that phileo uses eldarion-ajax, but out of the box, causes a HTTP 403 error because the AJAX request isn't sent with a CSRF token..
So I added the boilerplate ajax code from https://docs.djangoproject.com/en/1.7/ref/contrib/csrf/#ajax

HTH.

@paltman
Copy link
Contributor

paltman commented Oct 27, 2014

I would actually prefer this to be a separate include. We use pinax starter projects for all our work and as such we include the theme.js (https://github.com/pinax/pinax-theme-bootstrap/blob/master/pinax_theme_bootstrap/static/pinax/js/theme.js) in our base templates by default.

For those not using our starter projects, I think it's a good idea to pull this code you added into a csrf.js file and mention in the docs to include it if you are not already solving the csrf issue with another include in your project already.

Do you mind doing that?

  1. csrf.js
  2. documentation update about it

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants