发布网友
共1个回答
热心网友
首先,在django 视图函数中,传递 obj_list = [1, 2, 3] 类似这样的一个列表。def show_data(request): obj_list = [1, 2, 3] pass return render_to_response('index.html', {'obj_list': obj_list}) 然后在 index.html 模板文件中