django验证码模块 DjangoVerifyCode
- 授权协议: GPL
- 开发语言: Python
- 操作系统: 跨平台
- 软件首页: https://github.com/tianyu0915/DjangoVerifyCode
- 软件文档: https://github.com/tianyu0915/DjangoVerifyCode/blob/master/README.md
软件介绍
在django中生成英文单词验证码,提供验证码图片生成,检查验证码等功能.
安装
pip install DjangoVerifyCode or easy_install DjangoVerifyCode
显示验证码(views.py)
from DjangoVerifyCode import Code
def code(request):
code = Code(request)
return code.display()
检查用户输入的验证码是否正确(views.py)
from DjangoVerifyCode import Code
def index(request):
_code = request.GET.get('code') or ''
if not _code:
return render('index.html',locals())
code = Code(request)
if code.check(_code):
return HttpResponse('验证成功')
else:
return HttpResponse('验证失败')
自定义
用户可根据自己的需要对DjangoVerifyCode.Code对象的属性进行设置
输出图片的宽度
code.img_width = 150
输出图片的高度
code.img_height = 30
验证码字体颜色
code.font_color = ['black','darkblue','darkred']
字体大小
font_size = 24
依赖
- PIL
More
渐进增强的Web设计
[美] Todd Parker、[英] Patty Toland、[英] Scott Jehl、[法] Maggie Costello Wachs / 牛化成 / 人民邮电出版社 / 2014-1 / 69.00
本书由全球著名Web设计公司Filament集团两位创始人和两位开发主力联手打造,其中Scott Jehl还是jQuery团队成员。四位作者具有多年的网站设计和开发经验,曾为网站、无线设备、Web应用设计过众多高度实用的用户界面,受到了高度赞扬。本书展示了如何利用渐进增强方法开发网站,从而获得最佳用户体验。本书既是理解渐进增强原则和益处的实用指南,也用详细的案例分析,目的是向设计师以及开发人员传授......一起来看看 《渐进增强的Web设计》 这本书的介绍吧!
