Skip to main content

Add dynamic password authentication to your web service

Project description

Attention! Only for really paranoid people as me.

The project code and bugtracker is hosted on Bitbucket and Github.


django-dynamic-password is a django application which allow you to add dynamic password authentication for your web service.

How it works?

Verifies provided password according to DYNAMIC_PASSWORD_PATTERN in your You can also enable this feature only for STAFF users, see below.

You can format the value of your DYNAMIC_PASSWORD_PATTERN according to:

Some examples. Let’s assume that today is September 29th, 2022, 8:01 (09-29-2022 8:01). Say your username is “admin” and password “s3kr3t”, according to your DYNAMIC_PASSWORD_PATTERN in you will have:

Case 1:

only today valid password: s3kr3t29

Case 2:

only this hour valid password: 29s3kr3t08

Case 3:

only this minute valid password: 29s3kr3t08-01


There are a few different ways to install dynamic_password:

Using pip

If you have pip install available on your system, just type:

pip install django-dynamic-password

If you’ve already got an old version of dynamic_password, and want to upgrade, use:

pip install -U django-dynamic-password

Installing from a directory

If you’ve obtained a copy of dynamic_password using either Mercurial or a downloadable archive, you’ll need to install the copy you have system-wide. Try running:

python develop

If that fails, you don’t have setuptools or an equivalent installed; either install them, or run:

python install

How to configure dynamic_password?

If you have already installed dynamic_password app, you must proceed with the configuration of your project.

Add dynamic_password to the INSTALLED_APPS

Once the dynamic_password is in your Python path, you need to modify the INSTALLED_APPS setting to include the dynamic_password module:

    # ...,
    # Third-party
    # ...,

Enable the custom authentication backend

To activate this backend you need at least put dynamic_password.backends. DynamicPasswordBackend line to the AUTHENTICATION_BACKENDS tuple:

‘dynamic_password.backends.DynamicPasswordBackend’, )


Add this line to your


change it’s value according to your needs. Some examples:


You can format this value according to:


In order to enable dynamic_password only for staff users you can add this line to your


Future development plans

  • Enable “per user” dynamic password, DYNAMIC_PASSWORD_USERS = (‘user1’, ‘user2’, )

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 dynamic_password, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size dynamic_password-0.0.3.tar.gz (5.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page