INNER CODE UNIT · Python

index

kingname/SourceCodeofMongoRedis · chapter_10/QASystem/main.py:16

def index():
    question_list = mongo.query_question()
    return render_template('index.html', question_list=question_list)


@app.route('/question')
@app.route('/question/<question_id>')
def question_detail(question_id=None):
    if question_id:
        question_answer_dict = mongo.query_answer(question_id)
    return render_template('answer_list.html', question_answer_dict=question_answer_dict)


@app.route('/post_answer', methods=['POST'])
def post_answer():
    answer = request.json
    is_valid = check_answer_valid(answer)
    if not is_valid['success']:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…