feat(users): configures session with sqlalchemy
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from flask import Flask
|
||||
from flask_session import Session
|
||||
|
||||
from config import Config
|
||||
from app.extensions import db
|
||||
@@ -7,8 +8,10 @@ from app.utils import DBUtils, ROUTES
|
||||
def create_app(config_class=Config):
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(config_class)
|
||||
|
||||
app.config['SESSION_SQLALCHEMY'] = db
|
||||
|
||||
db.init_app(app)
|
||||
|
||||
@app.context_processor
|
||||
def inject_routes():
|
||||
"""Inject ROUTES dictionary into all templates."""
|
||||
@@ -19,7 +22,7 @@ def create_app(config_class=Config):
|
||||
DBUtils.setup_db(app)
|
||||
|
||||
# Initialize Flask extensions here
|
||||
|
||||
Session(app)
|
||||
# Register blueprints here
|
||||
from app.main import bp as main_bp
|
||||
app.register_blueprint(main_bp)
|
||||
|
||||
Reference in New Issue
Block a user