Metadata-Version: 2.1
Name: common-captcha
Version: 1.0.0
Summary: common captcha for web server
Home-page: https://github.com/Asamusummer/common_captcha
Author: lei.wang
Author-email: yqslwl@163.com
License: BSD-3-Clause
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.1
Classifier: Framework :: Django :: 4.2
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: redis (>=4.0.2)

==============
common_captcha
==============

验证码程序，包括简单验证码和滑块验证码

Introduction
====================================

Install with pip:

.. code-block:: console

    $ python -m pip install common-captcha


How To Use?
====================================

在此之前，你需要准备一个可用的redis

.. code-block:: console

    redis_url redis://xxxxxx:xxxxxx@xxxxx:xxx/11


简单验证码:

.. code-block:: python

    from common_captcha.strategy.simple_captcha import SimpleCaptcha

    simple_captcah = SimpleCaptcha(redis_url="redis://xxxxxx:xxxxxx@xxxxx:xxx/11")
    print(simple_captcah.get())
    print(simple_captcah.verify({"token": "", "code": ""}))


滑块验证码:

.. code-block:: python

    from common_captcha.strategy.block_puzzle_captcha import BlockPuzzleCaptcha

    block_captcha = BlockPuzzleCaptcha(redis_url="redis://xxxxxx:xxxxxx@xxxxx:xxx/11")
    print(block_captcha.get())
    print(block_captcha.verify(token="", point_json={"x": "", "y": ""}))

