1

I am using flask security and sqlalchemy to store user credentials but unfortunately flask 2.3 does not suppport security = Security(app, user_datastore) any assistance would be appreicated.

I tried the following user_datastore = SQLAlchemyUserDatastore(db, User, Role) security = Security(app, user_datastore) but i get AttributeError: 'Flask' object has no attribute 'before_first_request'. Did you mean: '_got_first_request'? when i disable the security = Security(app, user_datastore), it works fine but it will not store the first time login credentials to database

shaik moeed
  • 5,300
  • 1
  • 18
  • 54
Dejene T.
  • 973
  • 8
  • 14

2 Answers2

2

The package Flask-Security is no longer maintained - there are a couple options- I maintain Flask-Security-Too which started from Flask-Security 3.0 and has had many improvements and is compatible with latest Flask/Werkzeug.

jwag
  • 662
  • 5
  • 6
0

For version 2.3.x. You can remove the decorator @before_first_request and move the code to out of function. It should work.

NickNiu
  • 41
  • 4