https://github.com/memclutter/django-lite-captcha
Lite captcha for django projects
https://github.com/memclutter/django-lite-captcha
captcha django python
Last synced: about 2 months ago
JSON representation
Lite captcha for django projects
- Host: GitHub
- URL: https://github.com/memclutter/django-lite-captcha
- Owner: memclutter
- License: apache-2.0
- Created: 2018-10-14T10:24:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-03T21:15:55.000Z (over 2 years ago)
- Last Synced: 2025-10-27T03:29:23.592Z (5 months ago)
- Topics: captcha, django, python
- Language: Python
- Size: 11.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Django Lite Captcha
[](https://img.shields.io/badge/language-python-blue.svg)
[](https://github.com/memclutter/django-lite-captcha)
Lite captcha for django projects. This package don't use database for store captcha.
Detailed documentation is in the "docs" directory.
## Quick start
0. Install package
```
pip install lite_captcha
```
1. Add "lite_captcha" to your INSTALLED_APPS setting like this::
```python
INSTALLED_APPS = [
# ...
'lite_captcha',
]
```
2. Configure `MEDIA_URL` and `MEDIA_ROOT`:
3. Use form field in your forms:
```python
from django import forms
from lite_captcha.forms import LiteCaptchaField
class ContactForm(forms.Form):
email = forms.EmailField(required=True)
message = forms.CharField(required=True, widget=Textarea)
captcha = LiteCaptchaField(required=True)
```
4. Set session instance in views
```python
# ... in some views
if request.method == 'POST':
form = ContactForm(request.POST)
form.fields['captcha'].session = request.session
if form.is_valid():
return HttpResponseRedirect('/')
else:
form = ContactForm()
form.fields['captcha'].session = request.session
# ...
```
5. Override templates or use default.
6. Optional, change default django session backend for more performance.