26 lines
665 B
Python
26 lines
665 B
Python
import os
|
|
from flask import Flask, render_template
|
|
import database
|
|
|
|
app = Flask(__name__)
|
|
environment_configuration = os.environ['CONFIGURATION_SETUP']
|
|
app.config.from_object(environment_configuration)
|
|
|
|
|
|
@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()
|