1. 安装包文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/30515.html
pip install django-multi-captcha-admin django-simple-captcha
文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/30515.html
2. setting.py文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/30515.html
INSTALLED_APPS = [ 'xxxxxxx', #系统内置的模块 '....', 'app01', 'multi_captcha_admin', #1 'django.contrib.admin', #2 把默认的admin剪切放到这里,固定这个顺序, 'captcha', #3 ]
MULTI_CAPTCHA_ADMIN = { 'engine': 'simple-captcha', } # 选择recaptcha2
同时还支持recaptcha 和recaptcha2两种方式,但是由google提供,需要FQ。(人机验证,语音验证)文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/30515.html
文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/30515.html
3.urls.py文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/30515.html
urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^captcha/', include('captcha.urls')), ]
文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/30515.html
4.初始化文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/30515.html
python manage.py migrate python manage.py createsuperuser
5. 访问文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/30515.html
文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/30515.html