title: DatePickerWidget with Flask, Flask-Admin and WTforms
body: <p>I'm trying to render a template that contains a DatePicker, but I'm getting a 500 error when I try. For my the code is correct, but it seems that something is failing or I'm not understanding correctly the way to do it.</p>
  
  <p>The code is the following:</p>
  
  <p>Reporting.py</p>
  
  <pre><code>from flask.ext.admin import BaseView, expose
  from wtforms import DateField, Form
  from wtforms.validators import Required
  from flask.ext.admin.form import widgets
  from flask import request
  
  class DateRangeForm(Form):
      start_date = DateField('Start', validators=[Required()], format = '%d/%m/%Y', description = 'Time that the event will occur', widget=widgets.DatePickerWidget)
  
  class ReportingView(BaseView):
      @expose('/')
      def index(self):
          form = DateRangeForm(request.form)
          return self.render('reporting.j2', form=form)
  </code></pre>
  
  <p>Reporting template:</p>
  
  <pre><code>{% extends 'admin/master.html' %}
  {% block body %}
      {{super()}}
      Working on it!
  
      {% if form %}
          {{form.start_date}}
      {% endif %}
  {% endblock %}
  </code></pre>