django - CSRF Token in Phonegap using AJAX -


i'm developing app phonegap uses django back-end. back-end uses csrf, need phonegap app use csrf can work django.

i've read can use csrf via ajax, haven't been able make work.

could please tell me example how can this?

just catch csrf_token in html page in script tag @ time of document ready

var csrf = {{ csrf_token }}

and via ajax pass parameter in js file

$.ajax({

     csrfmiddlewaretoken: csrf;      ..// 

});


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -