本文整理汇总了Python中DjangoCaptcha.Captcha.img_height方法的典型用法代码示例。如果您正苦于以下问题:Python Captcha.img_height方法的具体用法?Python Captcha.img_height怎么用?Python Captcha.img_height使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DjangoCaptcha.Captcha
的用法示例。
在下文中一共展示了Captcha.img_height方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_code
# 需要导入模块: from DjangoCaptcha import Captcha [as 别名]
# 或者: from DjangoCaptcha.Captcha import img_height [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()
示例2: verifycode
# 需要导入模块: from DjangoCaptcha import Captcha [as 别名]
# 或者: from DjangoCaptcha.Captcha import img_height [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()
示例3: code
# 需要导入模块: from DjangoCaptcha import Captcha [as 别名]
# 或者: from DjangoCaptcha.Captcha import img_height [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()
示例4: getVerificationCode
# 需要导入模块: from DjangoCaptcha import Captcha [as 别名]
# 或者: from DjangoCaptcha.Captcha import img_height [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()
示例5: ValidCode
# 需要导入模块: from DjangoCaptcha import Captcha [as 别名]
# 或者: from DjangoCaptcha.Captcha import img_height [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)