🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

django-puzzlecaptcha

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-puzzlecaptcha

PuzzleCaptcha: Simplified Math CAPTCHA Using Pillow Image Library

0.1.1
PyPI
Maintainers
1

django-puzzlecaptcha

PuzzleCaptcha: Simplified Math CAPTCHA Using Pillow Image Library

Preview

Features

  • Easy integration with Django projects
  • Use pillow & numpy to generate image
  • Customizable configuration

Installation

1. Install the Package

pip install django-puzzlecaptcha

2. Configure Django Settings

Add puzzlecaptcha to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'puzzlecaptcha',
    ...
]

3. Configuration

In your settings.py, you can customize the puzzlecaptcha behavior:

PUZZLECAPTCHA = {
    "CAPTCHA_FONT_SIZE": 35,
    "CAPTCHA_IMAGE_SIZE": (150, 50),
    "CAPTCHA_NOISE_LINES": 20,
    "CAPTCHA_NOISE_LINES_WIDTH": 2,
    "CAPTCHA_NOISE_COLOR": "black",
    "CAPTCHA_FOREGROUND_COLOR": "black",
    "CAPTCHA_BACKGROUND_COLOR": "white",
    "CAPTCHA_CACHE_PREFIX": "puzzlecaptcha",
    "CAPTCHA_CACHE_BACKEND": "default",
    "CAPTCHA_TIMEOUT": 300,
}

4. To Enable on Admin Login Form (Optional)

In your project's urls.py:

from puzzlecaptcha.forms import AdminAuthenticationForm

admin.site.login_form = AdminAuthenticationForm
admin.site.login_template = 'puzzlecaptcha/admin_login.html'

urlpatterns = [
    path("admin/", admin.site.urls),
    ....
]

Usage Example

from puzzlecaptcha.field import MathCaptchaField

class AuthenticationForm(form.Form):
    captcha = MathCaptchaField()

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License

Support

If you encounter any issues or have questions, please open an issue on GitHub.

Keywords

django

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts