1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
"""passlib.ext.django.models -- monkeypatch django hashing framework"""
from passlib.ext.django.utils import DjangoContextAdapter
# local
__all__ = ["password_context"]
#: adapter instance used to drive most of this
adapter = DjangoContextAdapter()
# the context object which this patches contrib.auth to use for password hashing.
# configuration controlled by ``settings.PASSLIB_CONFIG``.
password_context = adapter.context
#: hook callers should use if context is changed
context_changed = adapter.reset_hashers
# load config & install monkeypatch
adapter.load_model()
|