DEV Community

Cover image for Withdraw and modify restriction in password django application
sium_hossain
sium_hossain

Posted on

4 3

Withdraw and modify restriction in password django application

Forcing user to make strong password always a good practice. But for making a simple web application, too much restriction in password may caused loose interest user from creating account.

Withdraw all restriction by add this line in settings.py file

AUTH_PASSWORD_VALIDATORS = []
Enter fullscreen mode Exit fullscreen mode

If we want user has to put at least 8 characters we can do that by

 AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
        'OPTIONS': {
            'min_length': 8,
        }
    },
]
Enter fullscreen mode Exit fullscreen mode

Here is all possible choice to make restricted in user password

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
        'OPTIONS': {
            'min_length': 9,
        }
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]
Enter fullscreen mode Exit fullscreen mode

Official Documentation

from django official documentation site

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (1)

Collapse
 
stormytalent profile image
StormyTalent •

Perfect!

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs