尝试使用新的django 1.9版本,并通过以下方式创建一个超级用户:
python manage.py createsuperuser
Run Code Online (Sandbox Code Playgroud)
而我只是想为我的本地开发环境使用一个简单的密码,就像只有一个字符,django1.9升级到一个非常严格的密码验证策略,我该如何绕过呢?
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.
Run Code Online (Sandbox Code Playgroud)
sch*_*ggl 10
您可以在开发环境中更改AUTH_PASSWORD_VALIDATORS设置.请参阅文档:https://docs.djangoproject.com/en/1.9/topics/auth/passwords/#s-enabling-password-validation.它非常简单:您将识别导致您的警告消息的验证器.
使用复杂密码创建超级用户后,您可以在shell中将其设置为更容易的东西(./manage.py shell):
from django.contrib.auth.models import User
user = User.objects.get(username='your_user')
user.set_password('simple')
user.save()
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3060 次 |
| 最近记录: |