1:安裝驗證碼框架
pip install django-simple-captcha==0.4.6

2:在settings.py中,配置installed_apps

3:生成驗證碼對應的表格
python manage.py migrate

4:配置urls.py,導入驗證碼

5:在forms.py中注冊form

6:在views.py中,將register_form返回到前端頁面

7:在前端顯示驗證碼

運行效果如下所示:

8:設置驗證碼的錯誤提示信息為中文的自定義信息

9:獲取前端POST過來的注冊信息,存入數(shù)據(jù)庫
導入庫:from django.contrib.auth.hashersimport make_password
