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:    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 import User
    from import Role
    import 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 import LoginForm
    security = Security(flask_app, user_datastore, login_form=LoginForm)
    return security