It works if you apply the filer 'escapejs'. Thanks anyway.
On 26 Mar, 16:29, drk <[email protected]> wrote: > Just to rephrase it, I'm setting the data through a variable in a django > template, maybe that's not the best way to do it, I guess. > > Segunda-feira, 26 de Março de 2012 16h23min15s UTC+1, drk escreveu: > > > > > > > > > > > Yea, that was it. > > Also changing the url to just '/logout' > > > Thanks! > > > I'm having other problem now, the data that is getting sent to the > > javascript code from the server is json data, but the quote symbol " is > > returned as " > > and so I get an error when trying to parse it. > > > Segunda-feira, 26 de Março de 2012 08h16min49s UTC+1, jim escreveu: > > >> Do you have CSRF protection enabled? > > >>https://docs.djangoproject.com/en/dev/ref/contrib/csrf/ > > >> It will 403 POST requests unless they have the right token. > > >> Jim > > >> On Sun, Mar 25, 2012 at 11:24 PM, drk <[email protected]> wrote: > >> > Hi, so I have a application that works offline (with localStorage), > >> > and now I'm trying to get it to work in a server. > > >> > I'm having a problem sending the data to server, I'm using jquery: > > >> > $.ajax({ > > >> > type: 'POST', > >> > url: 'http://mysite.aa/logout/', > >> > data: JSON.stringify( stuff ), > >> > contentType: 'text/plain; charset=utf-8', > >> > complete: function() { console.log('complete'); } > >> > }); > > >> > and I get a 403 error. > > >> > In chrome's console: > > >> > POSThttp://mysite.aa/logout/403 (FORBIDDEN) > >> > XHR finished loading: "http://myserver.aa/logout/" > > >> > In server: > >> > [25/Mar/2012 17:20:43] "POST /logout/ HTTP/1.1" 403 2282 > > >> > Any ideas? > > >> > -- > >> > You received this message because you are subscribed to the Google > >> Groups "Django users" group. > >> > To post to this group, send email to [email protected]. > >> > To unsubscribe from this group, send email to > >> [email protected]. > >> > For more options, visit this group at > >>http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

