title: How to use a JQuery Datepicker with the Django template language
body: <p>Looked at <a href="https://stackoverflow.com/questions/9594081/how-to-use-jquery-ui-datepicker-as-a-django-widget">this link</a> and found some help but I am wondering how I can choose to use a JQueryUI Datepicker widget for a DateField I have in my models.py</p>
  
  <p><em>models.py</em></p>
  
  <hr>
  
  <pre><code>from django.db import models
  
  class EModel(models.Model):
  
      date = models.DateField(blank=False)
  </code></pre>
  
  <p><em>forms.py</em></p>
  
  <hr>
  
  <pre><code>from django import forms
  from models import EModel
  
  class EForm(forms.ModelForm):
      class Meta:
          model = EModel
  </code></pre>
  
  <p><em>form.html</em> - How Django renders my form. <strong>Not in the admin page</strong></p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;Form&lt;/title&gt;
      &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /&gt;
      &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
      &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" href="/resources/demos/style.css" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form action="" method="post"&gt;{% csrf_token %}
          {{ form.date }} &lt;!-- ***** --&gt;
          &lt;!-- The rest of my form --&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>I am hoping for a way to make my 'date' model field render as a JQueryUI Datepicker widget, but I have searched around and found no way to link the two (in my case).</p>
  
  <p><strong>SOLUTION</strong></p>
  
  <hr>
  
  <hr>
  
  <hr>
  
  <hr>
  
  <hr>
  
  <hr>
  
  <hr>
  
  <p>In my forms.py</p>
  
  <pre><code>from django import forms
  from models import EModel
  
  class EForm(forms.ModelForm):
      class Meta:
          model = EModel
          widgets = {
              'date' : forms.DateInput(attrs={'type':'date'})
          }
  </code></pre>