captcha

1 parent 1dc70c5b
......@@ -16,14 +16,13 @@ def img_captcha(request, length=5, chars=string.ascii_uppercase + string.digits)
a = AssetResolver('tangsel.base')
static_path = a.resolve('static').abspath()
captcha_path = os.path.abspath(os.path.join(captcha_files, file_name))
font_path = os.path.abspath(os.path.join(
static_path, 'fonts/arial.ttf'))
font_path = os.path.abspath(os.path.join(static_path, 'fonts/arial.ttf'))
log.debug(f"Font path: {font_path}")
log.debug(f"Captcha path: {captcha_path}")
captcha_image = captcha(drawings=[
background(color='#fff'),
text(fonts=[font_path],
drawings=[
offset(0.8)
]),
drawings=[offset(0.8)]),
noise(),
smooth()
], width=300)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!