Context processors

django-password-policies provides a context processor that adds password related variables to a context:

password_status

password_policies.context_processors.password_status(request)

Adds a variable determining the state of a user’s password to the context if the user has authenticated:

  • password_change_required

    Determines if the user needs to change his/her password.

    Set to True if the user has to change his/her password, False otherwise.

To use it add it to the list of TEMPLATE_CONTEXT_PROCESSORS in a project’s settings file:

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
    'django.contrib.messages.context_processors.messages',
    'password_policies.context_processors.password_status',
)