本文整理汇总了Python中DjangoCaptcha.Captcha.words方法的典型用法代码示例。如果您正苦于以下问题:Python Captcha.words方法的具体用法?Python Captcha.words怎么用?Python Captcha.words使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DjangoCaptcha.Captcha
的用法示例。
在下文中一共展示了Captcha.words方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: code
# 需要导入模块: from DjangoCaptcha import Captcha [as 别名]
# 或者: from DjangoCaptcha.Captcha import words [as 别名]
def code(request):
ca = Captcha(request)
ca.words = ['hello','world','helloworld']
ca_type = request.GET.get('type', 'word').lower()
assert ca_type in ['number', 'word']
ca.type = ca_type
return ca.display()
示例2: verifycode
# 需要导入模块: from DjangoCaptcha import Captcha [as 别名]
# 或者: from DjangoCaptcha.Captcha import words [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 words [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 words [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: code
# 需要导入模块: from DjangoCaptcha import Captcha [as 别名]
# 或者: from DjangoCaptcha.Captcha import words [as 别名]
def code(request):
ca = Captcha(request)
ca.words = ['hello', 'world', 'apple', 'orange', 'banana', 'xiaobei', 'beibei']
ca.type = 'number'
return ca.display()
示例6: captcha
# 需要导入模块: from DjangoCaptcha import Captcha [as 别名]
# 或者: from DjangoCaptcha.Captcha import words [as 别名]
def captcha(request):
ca = Captcha(request)
ca.words = ['a','b','c']
ca.type = 'number'
#ca.type = 'word'
return ca.display()