This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A simple way to use jSignature jQuery plugin in your Django projects.

It provides:

  • A form field and a form widget to handle jquery plugin through a Django form;
  • A model field to store a captured signature;
  • A mixin adding two fields (signature / signature_date) in any of your Django models.

INSTALL

For now:

pip install django-jsignature

USAGE

  • Add jsignature to your INSTALLED_APPS:
# settings.py
INSTALLED_APPS = (
...
'jsignature',
)
  • Use provided form field and widget:
# forms.py
from django import forms
from jsignature.forms import JSignatureField

class SignatureForm(forms.Form):
    signature = JSignatureField()
  • In your template
{{ form.media }}
<form action="." method="POST">
    {% for field in form %}
        {{ field.label_tag }}
        {{ field }}
    {% endfor %}
    <input type="submit" value="Save"/>
    {% csrf_token %}
</form>
  • Render image after form validation:
# views.py
from jsignature.utils import draw_signature
from myapp.forms import SignatureForm

def my_view(request):
    form = SignatureForm(request.POST or None)
    if form.is_valid():
        signature = form.cleaned_data.get('signature')
        if signature:
            # as an image
            signature_picture = draw_signature(signature)
            # or as a file
            signature_file_path = draw_signature(signature, as_file=True)

CUSTOMIZATION

JSignature plugin options are available in python:

  • Globally, in your settings:
# settings.py
JSIGNATURE_WIDTH = 500
JSIGNATURE_HEIGHT = 200
  • Specifically, in your form:
# forms.py
from jsignature.forms import JSignatureField
from jsignature.widgets import JSignatureWidget

JSignatureField(widget=JSignatureWidget(jsignature_attrs={'color': '#CCC'}))

Available settings are:

  • JSIGNATURE_WIDTH (width)
  • JSIGNATURE_HEIGHT (height)
  • JSIGNATURE_COLOR (color)
  • JSIGNATURE_BACKGROUND_COLOR (background-color)
  • JSIGNATURE_DECOR_COLOR (decor-color)
  • JSIGNATURE_LINE_WIDTH (lineWidth)
  • JSIGNATURE_UNDO_BUTTON (UndoButton)
  • JSIGNATURE_RESET_BUTTON (ResetButton)

IN YOUR MODELS

If you wan to store signatures, provided mixin gives a signature and a signature_date that update themselves:

from django.db import models
from jsignature.mixins import JSignatureFieldsMixin

class JSignatureModel(JSignatureFieldsMixin):
    name = models.CharField()

AUTHORS

CHANGELOG

0.8 (2014-12-04)

** New **

  • Add support for Python 3 (@Gagaro)
  • Add support for Django 1.7 (@Gagaro)

0.7.6 (2014-11-26)

** New features **

  • A setting to display (or not) the reset button has been added (@jsayles)

** Internal changes **

  • Rendering is now based on a template (@andybak)
  • Javascript is properly initialized (@andybak)
Release History

Release History

0.8

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.7.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-jsignature-0.8.tar.gz (21.4 kB) Copy SHA256 Checksum SHA256 Source Dec 4, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting