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

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -