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