【发布时间】:2021-02-19 22:24:40
【问题描述】:
在 Django 中,是否可以创建一个由查询集和文本字符串组合而成的 HttpResponse?
我想像这样的事情
objs = ModelName.objects.all()
text = "Some text"
allData = ??? #Some kind of operation (json.dumps, serializers, or ...) that combines the two
return HttpResonse(allData,content_type="application/json")
【问题讨论】:
标签: python json django django-views httpresponse