当前位置: 首页>>代码示例>>Python>>正文


Python Captcha.img_width方法代码示例

本文整理汇总了Python中DjangoCaptcha.Captcha.img_width方法的典型用法代码示例。如果您正苦于以下问题:Python Captcha.img_width方法的具体用法?Python Captcha.img_width怎么用?Python Captcha.img_width使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DjangoCaptcha.Captcha的用法示例。


在下文中一共展示了Captcha.img_width方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_code

# 需要导入模块: from DjangoCaptcha import Captcha [as 别名]
# 或者: from DjangoCaptcha.Captcha import img_width [as 别名]
def get_code(request):
	ca = Captcha(request)
	#ca.words = ['hello', 'world', 'helloworld']
	ca.type = 'number' #or word
	ca.img_width = 150
	ca.img_height = 30
	return ca.display()
开发者ID:pgkk,项目名称:django-ozgweb,代码行数:9,代码来源:views_admin.py

示例2: verifycode

# 需要导入模块: from DjangoCaptcha import Captcha [as 别名]
# 或者: from DjangoCaptcha.Captcha import img_width [as 别名]
def verifycode(request):
    figures = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
    ca = Captcha(request)
    ca.words = [''.join([str(random.sample(figures, 1)[0]) for i in range(0, 4)])]
    ca.type = 'word'
    ca.img_width = 60
    ca.img_height = 20
    return ca.display()
开发者ID:yfjelley,项目名称:publish,代码行数:10,代码来源:views.py

示例3: code

# 需要导入模块: from DjangoCaptcha import Captcha [as 别名]
# 或者: from DjangoCaptcha.Captcha import img_width [as 别名]
def code(request):
    ca=Captcha(request)
    figures = [2,3,4,5,6,7,8,9]
    ca.words = [''.join(str(random.sample(figures,1)[0]) for i in range(0,4))]
    ca.type= 'word'
    ca.img_height = 30
    ca.img_width = 100
    return ca.display()
开发者ID:L-Angel,项目名称:sdustoj,代码行数:10,代码来源:View_verify.py

示例4: getVerificationCode

# 需要导入模块: from DjangoCaptcha import Captcha [as 别名]
# 或者: from DjangoCaptcha.Captcha import img_width [as 别名]
def getVerificationCode(request):
    ca = Captcha(request)
    figures = [2, 3, 4, 5, 6, 7, 8, 9]
    ca.img_width = 103
    ca.img_height = 30
    ca.words = [''.join([str(random.sample(figures, 1)[0]) for i in range(0, 4)])]
    ca.type = 'word'
    # print ca.words
    return ca.display()
开发者ID:lishao842000,项目名称:DjangoProject_filesStareSystem,代码行数:11,代码来源:views.py

示例5: ValidCode

# 需要导入模块: from DjangoCaptcha import Captcha [as 别名]
# 或者: from DjangoCaptcha.Captcha import img_width [as 别名]
def ValidCode(request):
    mod = request.REQUEST.get("a", "")
    if mod <> "check":
        ca = Captcha(request)
        # ca.words = ['hello','world','helloworld']
        ca.type = 'number'
        # ca.type = 'word'
        ca.img_width = 140
        ca.img_height = 30
        return ca.display()
    else:
        _code = request.GET.get('code')
        ca = Captcha(request)
        if ca.check(_code):
            J = Json_Code(data='', msg="验证成功", error=0)
        else:
            J = Json_Code(data='', msg="验证失败", error=1)
        return HttpResponse(J)
开发者ID:banjin,项目名称:klb,代码行数:20,代码来源:views.py

示例6: captcha_view

# 需要导入模块: from DjangoCaptcha import Captcha [as 别名]
# 或者: from DjangoCaptcha.Captcha import img_width [as 别名]
def captcha_view(request):
    ca = Captcha(request)
    ca.img_width = 100
    ca.type = 'word'
    return ca.display()
开发者ID:zouyapeng,项目名称:AccountSystem,代码行数:7,代码来源:views.py


注:本文中的DjangoCaptcha.Captcha.img_width方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。