Skip to content

Commit

Permalink
Implement flask-migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
smathot committed Jan 10, 2025
1 parent 0c459fa commit 45e99d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies = [
"flask-sqlalchemy",
"flask-wtf",
"flask-cors",
"flask-migrate",
"jinja2",
"jq",
"langchain",
Expand Down
4 changes: 3 additions & 1 deletion sigmund/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
os.environ['USE_FLASK_SQLALCHEMY'] = '1'
from flask import Flask, Config, request
from flask_login import LoginManager
from flask_migrate import Migrate
from . import config
from .routes import api_blueprint, app_blueprint, User, subscribe_blueprint, \
google_login_blueprint, public_blueprint
Expand Down Expand Up @@ -30,7 +31,8 @@ def create_app(config_class=SigmundConfig):
db.create_all()
# Initialize login manager
login_manager = LoginManager()

# Set up database migration
migrate = Migrate(app, db)
@login_manager.user_loader
def load_user(user_id):
return User(user_id)
Expand Down

0 comments on commit 45e99d8

Please sign in to comment.