title: Flask & WTForms: DatePicker Widget to display a date
body: <p>I have a small Flask app which has three fields (Destination, Start Time and End Time). I'd like to use DatePicker widget to display the calender when selecting start and end dates.</p>
  
  <p>With my current scripts the date widget doesn't spawn at all. What am I missing here?</p>
  
  <p><code>app.py:</code></p>
  
  <pre><code># -*- coding: utf-8 -*- 
  
  from flask.ext.wtf import Form
  from wtforms import SubmitField, SelectField, DateField
  from flask import Flask, render_template, request
  from flask.ext.bootstrap import Bootstrap
  from flask.ext.admin.form.widgets import DatePickerWidget
  
  class GeneralForm(Form):
      destination = SelectField(choices = data)
      start_time = DateField('Start at', widget=DatePickerWidget())
      end_time = DateField('End at', widget=DatePickerWidget())
      submit = SubmitField('Submit')
  
  @app.route("/", methods=['GET', 'POST'])
  def index():
      form = GeneralForm(request.form)
      if request.method == 'POST':
          destination = form.destination.data
          start_time = form.start_time.data
          end_time = form.end_time.data
          return render_template('page.html', form=form)
      else:
          return render_template('index.html', form=form)
  
  bootstrap = Bootstrap(app)
  if __name__ == '__main__':
      app.run(debug=True)
  </code></pre>
  
  <p><code>index.html:</code></p>
  
  <pre><code>&lt;link rel="stylesheet"
        href="{{url_for('.static', filename='mystyle.css')}}"&gt;
  &lt;link rel="stylesheet"
        href="{{url_for('.static', filename='datepicker.css')}}"&gt;
  &lt;link rel="javascript"
        href="{{url_for('.static', filename='main.js')}}"&gt;
  &lt;link rel="javascript"
        href="{{url_for('.static', filename='bootstrap-datepicker.js')}}"
  
  &lt;form action="#" method="post"&gt;
       {{ form.destination }}
       {{ form.start_time(class='datepicker') }}
       {{ form.end_time(class='datepicker') }}
       {{ form.submit }}
  &lt;/form&gt;
  </code></pre>