Skip to content

Instantly share code, notes, and snippets.

@gajanan0707
Created July 30, 2022 15:18
Show Gist options
  • Save gajanan0707/5bf84afc9514e693ee77edeafcae07af to your computer and use it in GitHub Desktop.
Save gajanan0707/5bf84afc9514e693ee77edeafcae07af to your computer and use it in GitHub Desktop.
"""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