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

+import questions from json

parent c8fcf152
No related branches found
No related tags found
No related merge requests found
from flask import Flask from flask import Flask
from view.questions import questions from view.questions import questions
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 = Flask(__name__)
app.config['SECRET_KEY'] = 'blubb' app.config['SECRET_KEY'] = 'blubb'
app.register_blueprint(questions) app.register_blueprint(questions)
......
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