前言
都是json模块搞的鬼!
def post(self, request): print("get ajax") if request.is_ajax: print(request.POST) article_type = request.POST.get('article_type') title = request.POST.get('title') summary = request.POST.get('summary') publish = request.POST.get('publish') editor = request.POST.get('editor') print("article_type:", article_type, "title:", title, "summary:", summary, "publish:", publish, "editor:", editor) return HttpResponse(json.dumps("成功!",ensure_ascii=False), content_type='application/json', charset='utf-8')
博客搬运地址