django-jsignature icon indicating copy to clipboard operation
django-jsignature copied to clipboard

form.media is empty

Open joshuakoh1 opened this issue 3 years ago • 1 comments

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 }}

joshuakoh1 avatar Jun 18 '22 21:06 joshuakoh1

Fixed it by manually adding the files to the page template but would be nice to know why it didn't work

<script src="{% static 'js/jSignature.min.js' %}"></script>
<script src="{% static 'js/django_jsignature.js' %}"></script>

joshuakoh1 avatar Jun 19 '22 09:06 joshuakoh1

Added test and could not reproduce

SebCorbin avatar Jan 27 '24 21:01 SebCorbin