diff --git a/ref-test/app/__init__.py b/ref-test/app/__init__.py index be5f4bf..86f7383 100644 --- a/ref-test/app/__init__.py +++ b/ref-test/app/__init__.py @@ -1,5 +1,5 @@ from .config import Production as Config -from .models import User +from .models import * from .extensions import bootstrap, csrf, db, login_manager, mail from .tools.logs import write @@ -58,5 +58,11 @@ def create_app(): app.register_blueprint(quiz) app.register_blueprint(editor, url_prefix='/admin/editor') app.register_blueprint(view, url_prefix='/admin/view') - + + """Create Database Tables before First Request""" + @app.before_first_request + def _create_database_tables(): + with app.app_context(): + db.create_all() + return app \ No newline at end of file