You could simply add
csrfmiddlewaretoken:
document.getElementsByName('csrfmiddlewaretoken')[0].value,
to the parameters on $.post. That would surely prevent the 403.
Em segunda-feira, 30 de maio de 2011 12:03:46 UTC-3, doktoreas escreveu:
>
> Thank you very much, for your help and your code.
On Mon, May 30, 2011 at 08:03:46AM -0700, Luca Casagrande wrote:
> Thank you very much, for your help and your code.
> The problem is that the POST request is missing the csrf_token and so
> I have got a 403 Error.
https://docs.djangoproject.com/en/1.3/ref/contrib/csrf/#ajax
--
Kirill Spitsin
-
Hi Radovan,
this code should go on a web page before the real application.
Basically I'd like to have the user click on a flag representing the
language and load the real site with the appropriate language.
Thanks
L.
On 30 Mag, 15:30, urukay wrote:
> hi,
>
> but you have to reload the whole page
hi,
but you have to reload the whole page anyway or you want only part of
the page to be translated?
There's a way to change language without form.
R.
On 30. Máj, 13:07 h., Luca Casagrande
wrote:
> Hello everybody,
> I'd like to use an AJAX request without any form to change the
> language of m
Hello everybody,
I'd like to use an AJAX request without any form to change the
language of my site.
My problem is that I haven't found a way to avoid the csrf_token
error..
How can I generate the token without any form?
The other way it to use setlang with a GET request but, according to
docs, th
5 matches
Mail list logo