DjangoCaptchaDjango验证码库
在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
评论
iCaptchaJava验证码库
iCaptcha是一个Java的验证码库,支持国际化和可定制。示例代码://OptionalPropertiesPropertiesprops=newProperties();props.put("f
iCaptchaJava验证码库
0
JCaptchaJava验证码生成库
JCaptcha是一个用来生成验证码的开源Java类库,目前最新的版本是2.0。目标为JAVA提供强大可靠的CAPTCHA实施框架提供可访问的验证码实施提供多种类型的挑战(文本,声音,图像)
JCaptchaJava验证码生成库
0