项目作者: Blueshoe

项目描述 :
Enterprise-grade django password management :key:
高级语言: Python
项目地址: git://github.com/Blueshoe/django-secure-passwords.git
创建时间: 2021-03-23T14:49:38Z
项目社区:https://github.com/Blueshoe/django-secure-passwords

开源协议:MIT License

下载


django-secure-passwords logo


Build Status
Quality Gate Status
Coverage Status
Code style: black
License: MIT

Todo

Installation

django-secure-passwords is currently available only on Blueshoe’s Python Package Index.

  1. pip3 install django-secure-passwords

Add “django-secure-passwords” to your INSTALLED_APPS:

  1. INSTALLED_APPS = [
  2. "...",
  3. "securepasswords",
  4. ]

Tracking of login attempts and account blocking

To track login attempts and lock account after a number of unsuccessful attempts use
django-axes package. It can log successful and unsuccessful attempts, saving
this information to the database. The record consists of time of login, IP address, user
agent, username, path to which the login was attempted and the number of failed attempts.

To install this package, run:

  1. pip3 install django-axes

Then, according to the installation guide you need
to add these settings to your settings.py file:

  1. INSTALLED_APPS = [
  2. '...',
  3. # Axes app can be in any position in the INSTALLED_APPS list.
  4. 'axes',
  5. ]
  1. AUTHENTICATION_BACKENDS = [
  2. # AxesBackend should be the first backend in the AUTHENTICATION_BACKENDS list.
  3. 'axes.backends.AxesBackend',
  4. '...',
  5. ]
  1. MIDDLEWARE = [
  2. # The following is the list of default middleware in new Django projects.
  3. '...',
  4. # AxesMiddleware should be the last middleware in the MIDDLEWARE list.
  5. # It only formats user lockout messages and renders Axes lockout responses
  6. # on failed user authentication attempts from login views.
  7. # If you do not want Axes to override the authentication response
  8. # you can skip installing the middleware and use your own views.
  9. 'axes.middleware.AxesMiddleware',
  10. ]

Different configuration variables are available,
those variables can be directly added to the settings.py file.

Usage

TODO prettify

Recommended: usage of AbstractBaseUser subclass as AUTH_USER_MODEL