Example #1
0
def verify_code():
    result = vc.generate()
    # 把验证码字符串保存到session
    session['code'] = vc.code
    # 创建响应对象
    response = make_response(result)
    response.headers["Content-Type"] = "image/png"
    return response
Example #2
0
def verify_code():
    vc.generate()
    return response
Example #3
0
File: views.py Project: Yichr/Yichr
def verifycode(requset):
    result = vc.generate()
    # session['code'] = vc.code
    response = HttpResponse(result, content_type='image/jpeg')
    return response
Example #4
0
def generate(request):
    from App.verifycode import vc
    data = vc.generate()

    # res.content_type = "image/png"
    return HttpResponse(data,'image/png')
Example #5
0
def verify_code():
    result = vc.generate()
    session['code'] = vc.code
    response = make_response(result)
    response.headers['Content-Type'] = 'image/png'
    return response