Python flask_security.SQLAlchemyUserDatastore() Examples

The following are 1 code examples of flask_security.SQLAlchemyUserDatastore(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module flask_security , or try the search function .
Example #1
Source File: __init__.py    From betterlifepsi with MIT License 5 votes vote down vote up
def init_flask_security(flask_app, database):
    from flask_security import SQLAlchemyUserDatastore, Security
    from psi.app.models.user import User
    from psi.app.models.role import Role
    import psi.app.config as config
    for key, value in config.BaseConfig.security_messages.items():
        flask_app.config['SECURITY_MSG_' + key] = value
    user_datastore = SQLAlchemyUserDatastore(database, User, Role)
    from psi.app.views.login_form import LoginForm
    security = Security(flask_app, user_datastore, login_form=LoginForm)
    return security