Created
July 30, 2022 15:18
-
-
Save gajanan0707/5bf84afc9514e693ee77edeafcae07af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Initialize Flask app.""" | |
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy | |
db = SQLAlchemy() | |
def create_app(): | |
"""Construct the core application.""" | |
app = Flask(__name__, instance_relative_config=False) | |
app.config.from_object("config.Config") | |
db.init_app(app) | |
with app.app_context(): | |
db.create_all() # Create database tables for our data models | |
return app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment