这个包包含django密码小部件的扩展,包括一个密码强度计和zxcvbn提供的破解时间。
django-password-strength的Python项目详细描述
#django密码强度
django密码小部件的扩展,包括由[zxcvbn]支持的密码强度计和破解时间(https://github.com/lowe/zxcvbn)。
![空密码](http://thegoods.aj7may.com/content/images/2013/dec/screen_shot_2013_12_18_at_9_05_38_am.png)
![弱密码](http://thegoods.aj7may.com/content/images/2013/dec/screen_shot_2013_12_18_at_9_06_05_am.png)
![强密码](http://thegoods.aj7may.com/content/images/2013/dec/screen_shot_2013_12_18_at_9_06_32_am.png)
安装:
`>;pip install django密码强度`
用法:
*将“django”密码强度添加到django项目的已安装应用程序中
*不要使用django“passwordinput”小部件,而是使用“passwordstrengthinput”`
*请确保模板中包含表单所需的媒体。_即{{form.media}`
*如果捆绑js,则可以使用“django_password_strength/js/zxcvbn.js”或“django_password_strength/js/zxcvbn async.js”和“django_password_strength/js/password_strength.js”
*为了便于集成,还包括[twitter bootstrap](http://getbootstrap.com/)
翻译:
目前还没有可用的翻译,但所有文本都是可翻译的,您只需自己翻译即可。
对于javascript翻译,请确保添加javascript翻译目录[由django提供](https://docs.djangoproject.com/en/1.7/topics/i18n/translation/使用javascript翻译目录)或使用类似于[django-statici18n](https://github.com/zyefryed/django-statici18n)的内容作为目录的静态版本。如果不需要翻译,则不必将目录添加到页面中。
示例:
u forms.py格式_
来自Django导入表单
从django_password_strength.widgets导入passwordstrengthinput,passwordconfirmationinput
类签名表单(forms.form):
用户名=forms.charfield()
密码短语=forms.charfield(
widget=passwordstrengthinput()
)
确认密码短语=forms.charfield(
小部件=密码确认输入()
)
使用多个密码字段的示例:
u forms.py格式_
来自Django导入表单
从django_password_strength.widgets导入passwordstrengthinput,passwordconfirmationinput
类签名表单(forms.form):
用户名=forms.charfield()
密码短语=forms.charfield(
widget=passwordstrengthinput()
)
确认密码短语=forms.charfield(
widget=passwordconfirmationinput(用'passphrase'确认)
)
passphrase2=表单.charfield(
widget=passwordstrengthinput()
)
确认密码2=forms.charfield(
widget=passwordconfirmationinput(用'passphrase2'确认)
)
django密码小部件的扩展,包括由[zxcvbn]支持的密码强度计和破解时间(https://github.com/lowe/zxcvbn)。
![空密码](http://thegoods.aj7may.com/content/images/2013/dec/screen_shot_2013_12_18_at_9_05_38_am.png)
![弱密码](http://thegoods.aj7may.com/content/images/2013/dec/screen_shot_2013_12_18_at_9_06_05_am.png)
![强密码](http://thegoods.aj7may.com/content/images/2013/dec/screen_shot_2013_12_18_at_9_06_32_am.png)
安装:
`>;pip install django密码强度`
用法:
*将“django”密码强度添加到django项目的已安装应用程序中
*不要使用django“passwordinput”小部件,而是使用“passwordstrengthinput”`
*请确保模板中包含表单所需的媒体。_即{{form.media}`
*如果捆绑js,则可以使用“django_password_strength/js/zxcvbn.js”或“django_password_strength/js/zxcvbn async.js”和“django_password_strength/js/password_strength.js”
*为了便于集成,还包括[twitter bootstrap](http://getbootstrap.com/)
翻译:
目前还没有可用的翻译,但所有文本都是可翻译的,您只需自己翻译即可。
对于javascript翻译,请确保添加javascript翻译目录[由django提供](https://docs.djangoproject.com/en/1.7/topics/i18n/translation/使用javascript翻译目录)或使用类似于[django-statici18n](https://github.com/zyefryed/django-statici18n)的内容作为目录的静态版本。如果不需要翻译,则不必将目录添加到页面中。
示例:
u forms.py格式_
来自Django导入表单
从django_password_strength.widgets导入passwordstrengthinput,passwordconfirmationinput
类签名表单(forms.form):
用户名=forms.charfield()
密码短语=forms.charfield(
widget=passwordstrengthinput()
)
确认密码短语=forms.charfield(
小部件=密码确认输入()
)
使用多个密码字段的示例:
u forms.py格式_
来自Django导入表单
从django_password_strength.widgets导入passwordstrengthinput,passwordconfirmationinput
类签名表单(forms.form):
用户名=forms.charfield()
密码短语=forms.charfield(
widget=passwordstrengthinput()
)
确认密码短语=forms.charfield(
widget=passwordconfirmationinput(用'passphrase'确认)
)
passphrase2=表单.charfield(
widget=passwordstrengthinput()
)
确认密码2=forms.charfield(
widget=passwordconfirmationinput(用'passphrase2'确认)
)