def send_message(request):
    if request.method == 'POST':
        message = MessageForm(request.POST)
message.save()
return HttpResponse(simplejson.dumps({'result': 'success'}), mimetype=
    'application/javascript')
Django + jQuery + Ajax