我怎样才能将第1类的学生详细信息作为第1类/第1类

时间:2019-04-24 04:44:37

标签: json python-3.x ubuntu

from flask import Flask, redirect, url_for, request
app = Flask(__name__)

@app.route('/classes/<class1>')
def classes(class1):
     class1 = {
  "student1":[ {"id": "0",
                "name": "vijay",
                "class": "1st",
                "teacher": "radha",},
            ],

  "student2":[ {"id": "1",
                "name": "sai",
                "class": "1st",
                "teacher": "yadhav"},
     ],
     }
     return jsonify(class1)

app.run()

错误: TypeError:无法散列的类型:'dict' 127.0.0.1--[24 / Apr / 2019 10:06:14]“ GET / classes / class1 HTTP / 1.1” 500- 我该如何解决这个问题

0 个答案:

没有答案