Skip to main content

Custom model backend for blocking users and ip after several attempts to access wrongly

Project description

Custom model backend for blocking users and ip after several attempts to access wrongly

Installation

  1. Install django-blockmodelbackend:

    pip install django-blockmodelbackend
    
  2. Add blockmodelbackend to your INSTALLED_APPS settings:

    INSTALLED_APPS = [
            ...
            'blockmodelbackend',
    ]
    
  3. Run migrate command:

    python manage.py migrate
    
  4. Add the new backend class to your AUTHENTICATION_BACKENDS settings:

    AUTHENTICATION_BACKENDS = [
            ...
            'blockmodelbackend.modelbackend.BlockModelBackend',
    ]
    

Configuration

There is some parameters to customize the backend.

. MAX_ACCESS_ATTEMPTS:[ 3 ] maximum numbers of wrong authentication attempts before blocking

. LOCK_DURATION:[ 5 ] lock duration in minutes

. DELTA_LOCK_DURATION:[ 1 ] increase in the lock duration in minutes

. USER_PERMANENT_BLOCK:[ False ] boolean value

. IP_PERMANENT_BLOCK:[ False ] boolean value

. BLOCK_TYPE:[ both ] choice between both, user or ip

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-blockmodelbackend, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size django_blockmodelbackend-0.3.0-py2.py3-none-any.whl (6.1 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django-blockmodelbackend-0.3.0.tar.gz (4.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page