def captcha(): im, code = make_simple_captcha(width=120, height=36, font_sizes=random.sample(range(40, 50), 4)) session["captcha"] = code img_io = StringIO() im.save(img_io, "JPEG", quality=70) img_io.seek(0) return send_file(img_io, mimetype="image/jpeg")
def captcha(): """Return captcha""" im, code = make_simple_captcha() session['captcha'] = code img_io = StringIO() im.save(img_io, 'JPEG', quality=70) img_io.seek(0) return send_file(img_io, mimetype='image/jpeg')