You're perfectly right. raw_post_data did the trick.
Thank you On Apr 25, 6:31 pm, Malcolm Tredinnick <malc...@pointy-stick.com> wrote: > On Thu, 2009-04-23 at 21:23 -0700, Francis wrote: > > Hi, I'm using dojo (also tried with jquery) to sendjsondata to my > > django application. > > > But I can't get it working properly. > > The trick to understanding is to think how are you sending the data? In > particular, what MIME type is being used? Django's HttpRequest.POST > variable is only set up to handle HTML form encoded data -- either > application/x-www-form-encoded or multipart/form-data is there are file > uploaded involved. I doubt very much that theJSONdata is being sent > with those encodings. Which means that your assumption to use > request.POST isn't valid. > > Instead, pass the submitted data -- obtained via request.raw_post_data > -- to aJSON-> Python converter (such as simplejson.decodestring()) and > then pass that dictionary into the form. > > Regards, > Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---