Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
tangsel-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5a6009ac
authored
May 27, 2025
by
aa.gustiana@gmail.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
captcha
1 parent
1dc70c5b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
tangsel/tools/captcha.py
tangsel/tools/captcha.py
View file @
5a6009a
...
@@ -16,14 +16,13 @@ def img_captcha(request, length=5, chars=string.ascii_uppercase + string.digits)
...
@@ -16,14 +16,13 @@ def img_captcha(request, length=5, chars=string.ascii_uppercase + string.digits)
a
=
AssetResolver
(
'tangsel.base'
)
a
=
AssetResolver
(
'tangsel.base'
)
static_path
=
a
.
resolve
(
'static'
)
.
abspath
()
static_path
=
a
.
resolve
(
'static'
)
.
abspath
()
captcha_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
captcha_files
,
file_name
))
captcha_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
captcha_files
,
file_name
))
font_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
font_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
static_path
,
'fonts/arial.ttf'
))
static_path
,
'fonts/arial.ttf'
))
log
.
debug
(
f
"Font path: {font_path}"
)
log
.
debug
(
f
"Captcha path: {captcha_path}"
)
captcha_image
=
captcha
(
drawings
=
[
captcha_image
=
captcha
(
drawings
=
[
background
(
color
=
'#fff'
),
background
(
color
=
'#fff'
),
text
(
fonts
=
[
font_path
],
text
(
fonts
=
[
font_path
],
drawings
=
[
drawings
=
[
offset
(
0.8
)]),
offset
(
0.8
)
]),
noise
(),
noise
(),
smooth
()
smooth
()
],
width
=
300
)
],
width
=
300
)
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment