This is lightweight version of django-simple-captcha for work with
django-rest-framework.
## Features
- speed: use cache insted database
- safety: union methods for generate key and image. (You can't generate many images for one key)
- easy: only one rest api (for generate, refresh image).
## Install
```
> pip install django-rest-captcha
```
## Add to project
Add to installed apps
```
INSTALLED_APPS = (
...
'rest_framework',
)
```
Set rest_captcha serrings (if you want):
```
REST_CAPTCHA = {
'CAPTCHA_CACHE': 'default',
'CAPTCHA_TIMEOUT': 300, # 5 minuts
'CAPTCHA_LENGTH': 4,
'CAPTCHA_FONT_SIZE': 22,
'CAPTCHA_IMAGE_SIZE': (90, 40),
'CAPTCHA_LETTER_ROTATION': (-35, 35),
'CAPTCHA_FOREGROUND_COLOR': '#001100',
'CAPTCHA_BACKGROUND_COLOR': '#ffffff',
'CAPTCHA_FONT_PATH': FONT_PATH,
'CAPTCHA_CACHE_KEY': 'rest_captcha_{key}.{version}',
'FILTER_FUNCTION': 'rest_captcha.captcha.filter_default',
'NOISE_FUNCTION': 'rest_captcha.captcha.noise_default'
}
```
We recommendete use radis or lacal memory as cache with set parameter, with bigger value of MAX_ENTRIES:
```
CACHES={
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': 'rest-captcha',
'MAX_ENTRIES': 10000,
}
}
```
Metadata
Release files for django-rest-captcha 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-rest-captcha-0.0.4.tar.gz | 52.6 kB | Without provenance | Details for django-rest-captcha-0.0.4.tar.gz |
Release files / django-rest-captcha-0.0.4.tar.gz
| Download URL | django-rest-captcha-0.0.4.tar.gz |
|---|---|
| Size | 52.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0443d537c9e0b493388acea762927c9bfd916c3c46c17a6b39625128189cbd7
|
|
BLAKE2b-256 checksum How to use checksums |
62efa844006dffb1ad41445e17512b9ad36bc4ff950b6cc771be95dcb0ee576e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-rest-captcha 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.