美文网首页
2018-06-21 返回json格式的数据

2018-06-21 返回json格式的数据

作者: 梦Delete | 来源:发表于2018-06-21 17:20 被阅读0次

def ajax_dict(request):

    name_dict = {'twz':'Love python and Django','zqxt':'I am teaching Django'}

    return HttpResponse(json.dumps(name_dict), content_type='application/json')

def ajax_dict(request):

    name_dict = {'twz':'Love python and Django','zqxt':'I am teaching Django'}

    return JsonResponse(name_dict)

相关文章

网友评论

      本文标题:2018-06-21 返回json格式的数据

      本文链接:https://www.haomeiwen.com/subject/vqdcyftx.html