Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set "simple" password in Django 1.9

Tags:

python

django

python manage.py createsuperuser --username admin

After that it prompts for password and when I enter "admin" I got the following message:

This password is too short. It must contain at least 8 characters. This password is too common.

I haven't seen this on earlier versions of Django.

like image 906
ig-melnyk Avatar asked Jan 27 '16 08:01

ig-melnyk


2 Answers

Tune your AUTH_PASSWORD_VALIDATORS setting by removing the django.contrib.auth.password_validation.CommonPasswordValidator out there.

Password validation is a new feature introduced in Django 1.9.

like image 117
Alex Morozov Avatar answered Sep 21 '22 16:09

Alex Morozov


Django 1.9 introduced password validators so this is what you're seeing, you can disable them in the settings.py but its not a good idea to do so.

You should heed its advice and set a stronger password!

See the documentation on Password Validation

If you do want to get around this, you can by doing it in a shell (or by writing your own management command) but I do not recommend this (read above)

from django.contrib.auth.models import User
User.objects.create_superuser('name', 'email', 'password')
like image 45
Sayse Avatar answered Sep 20 '22 16:09

Sayse