Django验证码库DjangoCaptcha.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
- 1
- 粉丝: 784
- 资源: 3万+
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于springboot+vue实现的在线考试系统+源代码+文档
- RTL8723DS 2022 版本 Linux驱动,android驱动 支持4.0-10x
- 要玩NDS的遊戲,必須要先下載三個bios檔案到你的檔案資料夾
- 各类型数据库4月排名,基于排名网站数据爬虫json结果
- 基于springboot+vue实现的在线考试系统+源代码+文档
- 淮北市杜集区人才补贴+生活补贴
- JAVA-JSP技术文档
- 课内实验02-决策表(共享单车月卡).docx
- 基于【React + Node+SpringBoot】疫情数据查看系统的设计与实现【源码+lw+部署+讲解】
- 基于【React + Node】云课堂系统设计与实现【源码+lw+部署+讲解】