验证码的实现

1.在github里面搜索djangocaptcha ,然后打开第一个,经行下载与安装(教程也有)

2.安装,pip install django-simple-captcha==0.4.6    (如果,你是虚拟环境的话,需要先进入虚拟环境,再进行安装)

3.在settigs.py 里面的 INSTALLED_APPS 的后面添加     'captcha',

4.在 urls.py里面添加url   

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

5.同步数据库:

python manage.py makemigrations

python manage.py migrate

6.在forms.py文件里面:

 

posted on 2017-11-02 11:36  chenyang13677  阅读(128)  评论(0)    收藏  举报