Skip to content
Snippets Groups Projects
Commit 678f4b5a authored by leo's avatar leo
Browse files

~propably something

parent 0667c19e
No related branches found
No related tags found
No related merge requests found
import json
from flask import Flask
from view.questions import questions
from model import Question
if len(Question.select()) is 0:
with open("questions.json", "r") as file:
question_list = json.load(file)
for text in question_list:
Question.create(text=text)
app = Flask(__name__)
app.config['SECRET_KEY'] = 'blubb'
app.register_blueprint(questions)
app.run(debug=True)
app.run(host='0.0.0.0')
......@@ -12,6 +12,6 @@
<input class="form-control" type="text" name="{{questid}}" value="">
<br><br>
{% endfor %}
<input type="submit" value="Submit">
<input type="submit" value="Abschicken">
</form>
{% endblock %}
......@@ -11,12 +11,6 @@ def index():
return render_template("feedback.jinja", message="Vielen Dank für deine Antworten!")
return render_template("index.jinja", questions=Question.select())
@questions.route("/debug")
def debug():
Question.create(text="Guten Morgen Linus!")
Question.create(text="Wer hat den Keks aus der Dose geklaut")
return "nice"
@questions.route("/submit", methods=["POST"])
def submit_answers():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment