refactor: adds new entry point and ORM
This commit is contained in:
16
app/__init__.py
Normal file
16
app/__init__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from flask import Flask
|
||||
|
||||
from config import Config
|
||||
from app.extensions import db
|
||||
|
||||
def create_app(config_class=Config):
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(config_class)
|
||||
db.init_app(app)
|
||||
# Initialize Flask extensions here
|
||||
|
||||
# Register blueprints here
|
||||
from app.main import bp as main_bp
|
||||
app.register_blueprint(main_bp)
|
||||
|
||||
return app
|
||||
2
app/extensions.py
Normal file
2
app/extensions.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
db = SQLAlchemy()
|
||||
Reference in New Issue
Block a user