Invenio-Accounts
raw JSON → 7.2.1 verified Fri May 01 auth: no python maintenance
Invenio module for user management and authentication. Handles user registration, login, password reset, and session management. Current version 7.2.1 (requires Python >=3.7). Released under the MIT license. Maintenance mode; new features are being integrated into InvenioRDM.
pip install invenio-accounts Common errors
error ModuleNotFoundError: No module named 'invenio_accounts' ↓
cause The package is not installed or is installed in a different environment.
fix
Run
pip install invenio-accounts in your current environment. error ImportError: cannot import name 'InvenioAccounts' ↓
cause Using an outdated import path. InvenioAccounts was previously located in invenio_accounts.ext or similar.
fix
Use
from invenio_accounts import InvenioAccounts. Warnings
breaking In version 7.0, the default hashing algorithm for passwords changed from bcrypt to scrypt. Existing passwords stored with bcrypt will fail to verify unless migrated. ↓
fix Run the provided upgrade script `invenio accounts upgrade` or manually rehash passwords with scrypt.
gotcha The `invenio-accounts` package does not include a ready-to-use user interface. You must integrate with Flask-Security or build custom templates. ↓
fix Install `Flask-Security` and configure it alongside Invenio-Accounts, or implement your own login/registration views.
Imports
- InvenioAccounts wrong
from invenio_accounts.models import InvenioAccountscorrectfrom invenio_accounts import InvenioAccounts - User
from invenio_accounts.models import User
Quickstart
from flask import Flask
from invenio_accounts import InvenioAccounts
app = Flask(__name__)
app.config['SECRET_KEY'] = 'change_this_key'
InvenioAccounts(app)
@app.route('/')
def index():
return 'Hello'
if __name__ == '__main__':
app.run()