mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
Initial commit
This commit is contained in:
36
.venv/Lib/site-packages/passlib/ext/django/models.py
Normal file
36
.venv/Lib/site-packages/passlib/ext/django/models.py
Normal file
@@ -0,0 +1,36 @@
|
||||
"""passlib.ext.django.models -- monkeypatch django hashing framework"""
|
||||
#=============================================================================
|
||||
# imports
|
||||
#=============================================================================
|
||||
# core
|
||||
# site
|
||||
# pkg
|
||||
from passlib.context import CryptContext
|
||||
from passlib.ext.django.utils import DjangoContextAdapter
|
||||
# local
|
||||
__all__ = ["password_context"]
|
||||
|
||||
#=============================================================================
|
||||
# global attrs
|
||||
#=============================================================================
|
||||
|
||||
#: 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
|
||||
|
||||
#=============================================================================
|
||||
# main code
|
||||
#=============================================================================
|
||||
|
||||
# load config & install monkeypatch
|
||||
adapter.load_model()
|
||||
|
||||
#=============================================================================
|
||||
# eof
|
||||
#=============================================================================
|
Reference in New Issue
Block a user