Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arthurc0102/django-handwriting-widget
A handwriting widget for django
https://github.com/arthurc0102/django-handwriting-widget
django handwriting widget
Last synced: 24 days ago
JSON representation
A handwriting widget for django
- Host: GitHub
- URL: https://github.com/arthurc0102/django-handwriting-widget
- Owner: arthurc0102
- Created: 2019-10-05T04:59:22.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-22T05:59:44.000Z (about 2 years ago)
- Last Synced: 2024-11-16T14:37:56.586Z (about 1 month ago)
- Topics: django, handwriting, widget
- Language: Python
- Size: 226 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Django Handwriting Widget
[![CircleCI](https://circleci.com/gh/arthurc0102/django-handwriting-widget.svg?style=svg)](https://circleci.com/gh/arthurc0102/django-handwriting-widget)
> A handwriting widget for django
## Installation
Install with `pip`
```
pip install django-handwriting-widget
```Add this app to `INSTALLED_APPS` in `settings.py`
```python
INSTALLED_APPS = [
...
'handwriting',
]
```## Usage
[Example model](e_signatures/models.py)
### Form
```python
from django import formsfrom handwriting.forms import HandwritingPad
from .models import Signature
class SignatureForm(forms.ModelForm):
class Meta:
model = Signature
fields = '__all__'
widgets = {
'image': HandwritingPad(),
}
```### Admin
```python
from django.contrib import adminfrom handwriting.admin import HandwritingPadModelAdmin
from .models import Signature
@admin.register(Signature)
class SignatureAdmin(HandwritingPadModelAdmin):
list_display = ('name', 'create_at')
```or
```python
from django.contrib import adminfrom handwriting.admin import HandwritingPadAdminMixin
from .models import Signature
@admin.register(Signature)
class SignatureAdmin(HandwritingPadAdminMixin, admin.ModelAdmin):
list_display = ('name', 'create_at')
```or
```python
from django.contrib import adminfrom .forms import SignatureForm
from .models import Signature@admin.register(Signature)
class SignatureAdmin(admin.ModelAdmin):
form = SignatureForm
list_display = ('name', 'create_at')
```