django code verification module

1. Download module

pip install django-simple-captcha   

2. Configure URL in a urls

url(r'^captcha/', include('captcha.urls')),

3.settiongs registration

INSTALLED_APPS = [
     'captcha',    
]

4. codes generated tables in the database

python manage.py  migrate

5. Add the forms assembly

from captcha.fields import CaptchaField
captcha=CaptchaField()

6. The front-end

{{ form.captcha}} 

  

Guess you like

Origin www.cnblogs.com/xzcvblogs/p/11365781.html