quiz-the-word/main.py

24 lines
579 B
Python
Raw Normal View History

2021-03-06 14:29:44 -08:00
from flask import Flask, render_template
import database
app = Flask(__name__)
app.config.from_pyfile("config.py")
@app.route("/")
def index():
easy = database.get_random_question_of_difficulty(database.HiddenAnswer, 1)
medium = database.get_random_question_of_difficulty(database.HiddenAnswer, 2)
hard = database.get_random_question_of_difficulty(database.HiddenAnswer, 3)
return render_template(
"hidden_answer.html",
title="Home",
easy=easy,
medium=medium,
hard=hard,
)
if __name__ == "__main__":
app.run()