Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

django-canvas-field

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-canvas-field

SignCanvasField

  • 1.0.0
  • PyPI
  • Socket score

Maintainers
1

Django Canvas Field

这是一个 Python 模块,为 Django 提供手写签名字段,以及手写签名的网页控件,感谢 jSignatrue 项目为本模块提供支持。

  1. 安装并注册模块

    # pip install django-canvas-field
    # File: settings.py
    INSTALLED_APPS = [
    	"canvas",
    ]
    
  2. 在模型中使用

    from canvas.fields import SignCanvasField
    
    class Simple(Model):
        name = CharField(max_length=20, unique=True)
        sign = SignCanvasField(null=True, blank=True)
    
  3. 使用签名控件

    from django import forms
    from canvas.widgets import SignCanvasWidget
    
    from .models import Simple
    
    class SimpleForm(forms.ModelForm):
        class Meta:
            model = Simple
            widgets = {
                'sign': SignCanvasWidget()
            }
    

SignCanvasWidgetdjango.forms.widgets.Textarea 的子类,使用自定义的模板 sign_canvas.htmlSignCanvasFielddjango.db.models.TextField 的子类,表单字段指向 SignCanvasWidget

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc