Skip to content

Commit a58c3c5

Browse files
committed
Add db import and create_all execution
1 parent 56f8066 commit a58c3c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/flaskr/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from flask_cors import CORS
55
import random
66

7-
from models import setup_db, Question, Category
7+
from models import setup_db, Question, Category, db
88

99
QUESTIONS_PER_PAGE = 10
1010

@@ -21,6 +21,8 @@ def create_app(test_config=None):
2121
"""
2222
@TODO: Set up CORS. Allow '*' for origins. Delete the sample route after completing the TODOs
2323
"""
24+
with app.app_context():
25+
db.create_all()
2426

2527
"""
2628
@TODO: Use the after_request decorator to set Access-Control-Allow

0 commit comments

Comments
 (0)