I am trying to add some roles/users with flask_security but run into this issue when I try to create users with the SQLAlchemySessionUserDatastore
. So I first start by creating user_datastore
like the guide
db = SQLAlchemy(app)
user_datastore = SQLAlchemySessionUserDatastore(db, User, Role)
security = Security(app, user_datastore)
user_datastore.create_user(email='test', password='passowrd')
this is where I deviate from the guide and try to just create a test user. Looks like the db = SQLAlchemy(app)
is causing me issues.
self.db.session.add(model)
AttributeError: 'SQLAlchemy' object has no attribute 'add'