Skip to main content

Django field for storing canvas signatures as blob or image

Project description

django-signature-field

Django field for storing canvas signatures as binary data or image files.

Purpose

Store signature pad output in the database either as a binary blob (default) or as an uploaded PNG file.

Installation

pip install django-signature-field

Quick Start

from django.db import models
from signature import SignatureField


class Contract(models.Model):
    title = models.CharField(max_length=100)

    # Default: binary storage
    signature = SignatureField()

    # Or explicitly as blob
    signature_blob = SignatureField(field_type="blob")

    # Or as image file
    signature_image = SignatureField(field_type="image", upload_to="signatures/")

Input formats

The field accepts:

  • Raw bytes
  • Base64 text
  • Data URLs (data:image/png;base64,...)

Field modes

field_type Storage Django field
"blob" (default) Raw PNG bytes in database BinaryField
"image" PNG file on storage ImageField

Development

pip install -e ".[dev]"
pytest

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_signature_field-0.1.0.tar.gz (191.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_signature_field-0.1.0-py3-none-any.whl (187.0 kB view details)

Uploaded Python 3

File details

Details for the file django_signature_field-0.1.0.tar.gz.

File metadata

  • Download URL: django_signature_field-0.1.0.tar.gz
  • Upload date:
  • Size: 191.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for django_signature_field-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f40f4e9f4188aac3306e0d72a502528573e02f000f0c47d8a529a57b792e7657
MD5 7e2d802fdf82bdce7d158664a9c1fbec
BLAKE2b-256 45b5d41da774b9cc31301b6747e4942bd4d0d91919a9a81cf8340c5291befc26

See more details on using hashes here.

File details

Details for the file django_signature_field-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_signature_field-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a3c6e38d821b97890e946e4410494dcc1c21e0bc259aac3fc1c0948fa9899b1
MD5 e269248357676d47e9c149247ce6893d
BLAKE2b-256 8d8c2e85ec0fd4c594ca2a242958c14ad66f0b604207b37599743b3eeaa065a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page