【发布时间】:2018-04-27 13:17:24
【问题描述】:
我正在查看函数
from django.shortcuts import render
from .models import myModel
def articleTheme(request):
if request.method == 'POST':
article_id = request.POST['id']
article = myModel.objects.get(id=article_id)
theme = article.theme
return render(request, 'theme.html', {'newTheme': theme })
现在它可以正常工作了。但是我有多余的html。我想返回 json 对象。 我可以导入和返回什么?
【问题讨论】: