mirror of
https://github.com/lepture/captcha.git
synced 2026-03-13 09:43:22 +08:00
40 lines
619 B
ReStructuredText
40 lines
619 B
ReStructuredText
Image Captcha
|
|
=============
|
|
|
|
.. rst-class:: lead
|
|
|
|
Unleash captivating security with image CAPTCHA mastery.
|
|
|
|
----
|
|
|
|
.. module:: captcha.image
|
|
:noindex:
|
|
|
|
Usage
|
|
-----
|
|
|
|
Generating image CAPTCHA with the :class:`ImageCaptcha` class is incredibly straightforward.
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
from io import BytesIO
|
|
from captcha.image import ImageCaptcha
|
|
|
|
captcha = ImageCaptcha()
|
|
data: BytesIO = captcha.generate('ABCD')
|
|
|
|
The result image would be something like:
|
|
|
|
.. figure:: ./_static/image-demo.png
|
|
|
|
This image CAPTCHA is generated by above code
|
|
|
|
Fonts
|
|
-----
|
|
|
|
You should use
|
|
|
|
Web server
|
|
----------
|