fle / django-jsignature Goto Github PK
View Code? Open in Web Editor NEWUse jSignature jQuery plugin in your django projects
License: GNU Lesser General Public License v3.0
Use jSignature jQuery plugin in your django projects
License: GNU Lesser General Public License v3.0
I follow the instructions here: https://github.com/fle/django-jsignature?tab=readme-ov-file#example-project
I altered the commands a bit for windows. I did the following.
d:
cd D:\code\pyprj\jsig\
git clone https://github.com/fle/django-jsignature.git
cd django-jsignature
python -m venv venv
.\venv\Scripts\activate.bat
rem source venv/bin/activate
pip install -r requirements.txt
pip install -e .
cd example_project
python manage.py migrate
I have looked at #17 and #41, but I don't think they cover this situation.
I get the following error.
(venv) d:\code\pyprj\jsig\django-jsignature\example_project>python manage.py migrate
Traceback (most recent call last):
File "d:\code\pyprj\jsig\django-jsignature\example_project\manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\prg\python128\Lib\site-packages\django\core\management\__init__.py", line 442, in execute_from_command_line
utility.execute()
File "C:\prg\python128\Lib\site-packages\django\core\management\__init__.py", line 416, in execute
django.setup()
File "C:\prg\python128\Lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\prg\python128\Lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\prg\python128\Lib\site-packages\django\apps\config.py", line 193, in create
import_module(entry)
File "C:\prg\python128\Lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'example_project'
(venv) d:\code\pyprj\jsig\django-jsignature\example_project>
I believe I have followed the instructions. Should that work, or am I doing something wrong?
Cannot add to INSTALLED_APP get No module named 'jsignature', after pip install
Hi,
I am getting a No module named 'example_project' when trying to migrate (using ./manage.py migrate).
Am I missing something?
Hello everything seems to have installed OK and I can see the signature box with the reset.
jQuery is installed however when I try and save I get this error
['Invalid format.']
Any ideas?
Thanks
How can i block the edit signature after save?
Just for the record:
DeprecationWarning: ANTIALIAS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.
im.thumbnail((width, height), Image.ANTIALIAS)
It should be noted that the requirement for placement of {{ form.media }} must be added to the end of your template file and not at the beginning as indicated in the docs. This ensures you JS is loaded after the form. So, place {{ form.media }} after your form or at the tail end of the template file. If you do not place it in the correct location, your signature box will not appear.
When using draw_signature()
, the signature is composed by rect-lines. So, it is a bit different and you can notice angles in the signature exported.
Checking the jSignature demo I see that they do not have this problem when exporting to other formats.
Hello,
form.media does not load anything when using a ModelForm
class TransactionCreateForm(forms.ModelForm):
signature = JSignatureField()
class Meta:
model = models.Transaction
fields = [ ..., 'signature']
The entire field is empty, only showing the reset button. Inspection of source shows that the template does not render anything under {{ form.media }}
We have django-jsignature installed in a django application and working perfectly. We started playing with using tablets or touchscreen chromebooks to collect signatures with a stylus or finger, but it only shows the inital spot where you tap the screen. It's actually the exact issue I found in the issues on jSignature's repo brinley/jSignature#186
I was curious if anyone had ran into this before, or if there is something I am not doing correctly.
This repo is awesome, thank you!
Edit: Works fine on my android phone using chrome. Chromebook and Windows do not like it. Also tried in "tablet mode" in windows.
How can I use signature through api
I use graphql with vue.js
How can I benefit from this project?
Thanks for this effort
Is there any chance to support Django 2.2.1 and Python 3.4?
There's no other projects like this out there.
File "/Users/pawisoon/PycharmProjects/GSMPanel/venv/lib/python3.6/site-packages/django/forms/boundfield.py", line 93, in as_widget
renderer=self.form.renderer,
TypeError: render() got an unexpected keyword argument 'renderer'
[21/Nov/2019 09:18:03] "GET /panel/mtn/edit/83/ HTTP/1.1" 500 59
after removing renderer=self.form.renderer,
it renders signature properly.
So it means #11 does not work in Django 2.2.1
Using draw_signature()
function to get an image of the signature does not keep customization settings (color, line_width).
The image line is always black and very thin.
It would be great to fix that.
Hi,
My use case for django-jsignature
stores the signatures together with other identifying information of users of my application.
It occurs to me that applying an encryption coder/decoder when storing signatures in the database would add protection in the event of a data breach. The encryption key could be another setting, eg:
JSIGNATURE_ENCRYPTION_KEY = os.environ.get('JSIGNATURE_ENCRYPTION_KEY')
Is this a feature you might consider adding?
Thanks!
It would be nice to integrate dropbox upload instead of keeping the images on the server :)
While testing this out, I drew a smiley face with a couple of dots for eyes and a mouth.
When drawing the face, it all appeared correctly.
When viewing the saved image though, the dots are missing. If I draw bigger dots, it works fine, but it's almost like tiny little dots aren't included in the data when saving.
Of course I don't expect anyone to draw smiley faces, but it's relevant to 'i' and 'j' letters.
django-jsignature/jsignature/widgets.py
Line 12 in 337a8f9
Should be changed to:
from django.utils.translation import gettext_lazy as _
django-jsignature/jsignature/widgets.py
Line 100 in 4883e37
I was thinking that we could write a view or perhaps modify this in place so that we are importing the "static" directory template and JS files here instead of as a hard-coded path. Was running into an issue on production where static assets are served from a different directory.
Using Django 3.1. Followed instructions in README.rst to run example project. Error raised when running python manage.py migrate
.
In our template we load all javascript just before the closing body tag. This includes the external jquery reference and {{ form.media }}
That means jQuery's $ isn't loaded by the time the javascript embedded in your widget is called giving an error.
Should your initialization be triggered by something in {{ form.media }} rather than directly in the widget html?
Just to let you know python manage.py check
is throwing an deprecation warning in Django 1.9 that appears to be related to django-jsignature:
/home/django/MY_PROJECT/env/lib/python3.4/site-packages/six.py:808: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.
Appears to come from fields.py:16
Thanks for the package, huge time saver!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.