Try to work on the new django 1.9 version, and create a super user by this:
python manage.py createsuperuser
And I just want to use a simple password for my local development environment, like only one character, django1.9 upgrade to a very strict password validation policy, how can I bypass it?
Password:
Password (again):
This password is too short. It must contain at least 8 characters.
This password is too common.
This password is entirely numeric.
validate(self, password, user=None) : validate a password. Return None if the password is valid, or raise a ValidationError with an error message if the password is not valid. You must be able to deal with user being None - if that means your validator can't run, return None for no error.
After creating the superuser with a complex password, you can set it to something easier in the shell (./manage.py shell):
from django.contrib.auth.models import User
user = User.objects.get(username='your_user')
user.set_password('simple')
user.save()
In fact, you do not need to modify the validator settings or first create a complex password and then later change it. Instead you can create a simple password directly bypassing all password validators.
Open the django shell
python manage.py shell
Type:
from django.contrib.auth.models import User
Hit enter and then type (e.g. to use a password consisting only of the letter 'a'):
User.objects.create_superuser('someusername', '[email protected]', 'a')
Hit enter again and you're done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With