File: models.py

package info (click to toggle)
python-passlib 1.9.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,184 kB
  • sloc: python: 26,132; makefile: 7
file content (21 lines) | stat: -rw-r--r-- 579 bytes parent folder | download
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()