Django验证码库DjangoCaptcha.zip

上传者: 39840387 | 上传时间: 2021-04-21 22:39:33 | 文件大小: 963KB | 文件类型: ZIP
在django中生成英文单词验证码,提供验证码图片生成,检查验证码等功能 原用于pythoner.net的验证码,现整理出来打包发布到pypi. 新特性 新增数字验证码模式 字体尺寸根据图片长宽自适应 Usage Install pip install DjangoCaptcha
or
easy_install DjangoCaptcha Display(views.py) from DjangoCaptcha import Captcha
def code(request):
ca = Captcha(request)
ca.words = ['hello','world','helloworld']
ca.type = 'number'
return ca.display() Check user input(views.py) from DjangoCaptcha import Captcha
def index(request):
_code = request.GET.get('code') or ''
if not _code:
return render('index.html',locals())

ca = Captcha(request)
if ca.check(_code):
return HttpResponse('验证成功')
else:
return HttpResponse('验证失败') Custom width of image ca.img_width = 150 height of image ca.img_height = 30 type fo code ('number'/'word') ca.type = 'number' Rely on PIL More http://pythoner.net

文件下载

资源详情

[{"title":"( 24 个子文件 963KB ) Django验证码库DjangoCaptcha.zip","children":[{"title":"DjangoCaptcha-master","children":[{"title":"DjangoCaptcha","children":[{"title":"words.list <span style='color:#111;'> 146B </span>","children":null,"spread":false},{"title":"Menlo.ttc <span style='color:#111;'> 2.07MB </span>","children":null,"spread":false},{"title":"__init__.py <span style='color:#111;'> 5.86KB </span>","children":null,"spread":false},{"title":"timesbi.ttf <span style='color:#111;'> 234.07KB </span>","children":null,"spread":false}],"spread":true},{"title":"test.py <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"__init__.py <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"demo","children":[{"title":"settings.py <span style='color:#111;'> 5.07KB </span>","children":null,"spread":false},{"title":"DjangoCaptcha <span style='color:#111;'> 16B </span>","children":null,"spread":false},{"title":"urls.py <span style='color:#111;'> 258B </span>","children":null,"spread":false},{"title":"manage.py <span style='color:#111;'> 242B </span>","children":null,"spread":false},{"title":"requirements.txt <span style='color:#111;'> 23B </span>","children":null,"spread":false},{"title":"__init__.py <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"env.sh <span style='color:#111;'> 278B </span>","children":null,"spread":false},{"title":"setenv.sh <span style='color:#111;'> 279B </span>","children":null,"spread":false},{"title":"main","children":[{"title":"DjangoCaptcha <span style='color:#111;'> 19B </span>","children":null,"spread":false},{"title":"urls.py <span style='color:#111;'> 149B </span>","children":null,"spread":false},{"title":"__init__.py <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"views.py <span style='color:#111;'> 866B </span>","children":null,"spread":false}],"spread":true},{"title":"templates","children":[{"title":"index.html <span style='color:#111;'> 824B </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":".travis.yml <span style='color:#111;'> 115B </span>","children":null,"spread":false},{"title":"LICENSE <span style='color:#111;'> 563B </span>","children":null,"spread":false},{"title":"setup.py <span style='color:#111;'> 463B </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 1.33KB </span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'> 1.93KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明