django-puzzlecaptcha
PuzzleCaptcha: Simplified Math CAPTCHA Using Pillow Image Library
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.
Release files for django-puzzlecaptcha 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_puzzlecaptcha-0.1.1.tar.gz | 5.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_puzzlecaptcha-0.1.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 13.3 kB
Release files / django_puzzlecaptcha-0.1.1.tar.gz
| Download URL | django_puzzlecaptcha-0.1.1.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47d09adb3b0197764ce36d6dc7bd443aa6698a7910b351161456e004adbacf03
|
|
BLAKE2b-256 checksum How to use checksums |
992fd2c1da05a1027a8db614c4e24c4f55c2cc3992d724589df9531630e183aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.13.0 Linux/6.11.10-300.fc41.x86_64
|
Release files / django_puzzlecaptcha-0.1.1-py2.py3-none-any.whl
| Download URL | django_puzzlecaptcha-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
0296d257c85a65d17a9821b045b908dcb230d07c8c41e742fac3361240ea3f9c
|
|
BLAKE2b-256 checksum How to use checksums |
48e1daa9b429c3814d2b5722b689be911fe4c2de75efa5661f6c79a2a31137cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.13.0 Linux/6.11.10-300.fc41.x86_64
|