Allora se ricordo bene.... o specifichi il content-type "application/x-www-form-urlencoded" per la richiesta oppure fai un parsing di request.body.
notte Il giorno gio 1 ott 2015 alle ore 19:20 Carlos Catucci < carlos.catu...@gmail.com> ha scritto: > Ho un comportamento strano di cui non riesco a venire a capo > > Lato JS faccio una ajax call come tante > > data = {'direction': direction, 'img': image}; > > $.ajax({ > 'url': url, > 'data': { > 'data': data, > 'csrfmiddlewaretoken': csrf_token, > }, > 'type': 'POST', > 'contentType': 'application/json; charset=utf-8', > 'dataType': 'text', > > 'success': function( response ) { > [.....] > > Mentre lato django > > def shift_news(request): > > print "request" > print request > print "request" > > if request.is_ajax(): > > try: > > data = json.loads(request.POST['data']) > > [....] > > Problema e che la print di request mi torna > > request > <WSGIRequest: GET '/en/home/shift_news/'> > request > > A parte che la chiamata e' in POST e non in GET, ma comunque dov'e' il > payload POST? > > Carlos > -- > EZLN ... Para Todos Todo ... Nada para nosotros > _______________________________________________ > Python mailing list > Python@lists.python.it > http://lists.python.it/mailman/listinfo/python >
_______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python