def addSrudent(): if request.method == 'GET': return render_template('student_add.html') else: name = request.form.get('name') english = request.form.get('english') python = request.form.get('python') c = request.form.get('c') stu = Student() stu.name = name stu.English = english stu.Python = python stu.C = c stu.Total_score = int(english) + int(python) + int(c) db.session.add(stu) db.session.commit() return redirect(url_for('index'))