예제 #1
0
def get_course():
    name = db.course.find_one()
    if name is None:
        print('No data!')
        courses = proComments.course()
        _id = db.course.insert_many(courses)
        print(_id)

    else:
        print('getting course data')
        name = []
        for cours in db.course.find():
            name.append(cours)
        print(name)
        return name
예제 #2
0
def home():
    details = proComments.details()
    students = proComments.course()
    print(students)
    return render_template('index.html', posts=[students, details])  # render a template