手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

python 验证码库 captcha的使用问题解决

时间:2024-10-12 01:17:31

1、先附上库的GitHub地址:https://github.com/mbi/django-simple-captch锾攒揉敫a看下帮助文档,如果把这个库应用到我们的项目中1.Download django-simple-captcha using pip by running: pip install django-simple-captcha 首先pip安装这个库2.. Add captcha to the INSTALLEDAPPS in your settings.py 然后在settings.py-->INSTALLEDAPPS

python 验证码库 captcha的使用问题解决

2、.Run python manage.py syncdb (or python manage.py migrate if you are managing database migrations via South) to create the required database tables执行makemigrations 命令 以及 migrate,生成对应的数据库文件,可以查看下数据库

python 验证码库 captcha的使用问题解决

3、Add an entry to your urls.py:配置url

python 验证码库 captcha的使用问题解决

4、这样我们准备工作就做好了,注册用到了这个验证码问题,具体的怎么实现的显示可以移步到登录注册看,当我们把所有代码逻辑写出执行,发现并没有出现预想的结果。而是。。。。。

python 验证码库 captcha的使用问题解决

5、然后一脸懵逼的 F12看了下竟然 。。。。

python 验证码库 captcha的使用问题解决

6、windows系统,使用PIL库的ImageFo艘绒庳焰nt.truetype()方法时,报错:The _imagingft C mo颊俄岿髭dule is not installed说明自己电脑里安装的PIL库缺少一个freetype的库文件,我也手动安装了这个库,出现了_imagingft.pyd,但是import _imagingft时报错说DLL无法加载。现在已解决了这个问题,解决方法:1、卸载原来版本的PILpip uninstall pil2、重新安装一个已经包含freetype库的PIL安装包,可以从该地址下载,并安装。

© 手抄报圈