title: Can't get single checkbox to render in Flask WTF
body: <p>I've been searching a long time for examples on how to use checkboxes with Flask WTF, but it seems like either there are no example or there are really complex ones that involve a list of checkboxes.</p>
  
  <p>I did find one example in Miguel's blog <a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-iii-web-forms" rel="nofollow noreferrer">here</a>, but I'm not able to get the checkbox to render. Here's what I did:</p>
  
  <p>First off, the form class:</p>
  
  <pre><code>class LoginForm(Form):
      email = TextField("Email address", validators=[validators.required()])
      password = PasswordField("Password", validators=[validators.required()])
      remember_me = BooleanField("Remember me", default = False)
      submit = SubmitField("Login")
  </code></pre>
  
  <p>And then in my template:</p>
  
  <pre><code>&lt;form class="form-signin" role="form" action="{{ url_for('login') }}" method="post"&gt;
      {{ form.hidden_tag() }}
      &lt;div class="form-group"&gt;
          {{ form.email.label }}
          {{ form.email ( ** {'class' : 'form-control'} ) }}
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          {{ form.password.label }}
          {{ form.password ( ** {'class' : 'form-control'} ) }}
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          {{ form.remember_me }} Remember me
      &lt;/div&gt;               
  &lt;/form&gt;
  </code></pre>
  
  <p>In the final output of the form, the checkbox is missing:</p>
  
  <p><a href="https://i.stack.imgur.com/Bf4hq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bf4hq.png" alt="enter image description here"></a></p>
  
  <p>If I see the generated HTML, the field is just missing:</p>
  
  <pre><code>&lt;form class="form-signin" role="form" action="/login" method="post"&gt;
                  &lt;div style="display:none;"&gt;&lt;input id="csrf_token" name="csrf_token" type="hidden" value="1457326344##3036eeab4ffa39494ee92247925a30a88a69432f"&gt;&lt;input id="next" name="next" type="hidden" value=""&gt;&lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;label for="email"&gt;Email Address&lt;/label&gt;
                  &lt;input class="form-control" id="email" name="email" type="text" value=""&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;label for="password"&gt;Password&lt;/label&gt;
                  &lt;input class="form-control" id="password" name="password" type="password" value=""&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                   Remember me             
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;input class="btn btn-primary btn-lg" id="submit" name="submit" type="submit" value="Login"&gt;
              &lt;/div&gt;          
              &lt;/form&gt;
  </code></pre>
  
  <p>Curiously, if I try to add <code>{{ form.remember_me.label }}</code> to the template, I get an exception that <code>jinja2.exceptions.UndefinedError: 'flask_security.forms.LoginForm object' has no attribute 'remember_me'</code>.</p>
  
  <p>I also came across some solutions that mention custom widgets, but I'm really hoping to hear I won't have to go that route for a simple, single checkbox.</p>
  
  <p>What am I doing wrong? If nothing, what's the shortest, most painless way to accomplish this?</p>
  
  <p><strong>~~~~Update~~~~</strong></p>
  
  <p>It looks like there's some weird behavior at work here. The field <code>form.remember</code> seems to produce a checkbox, and <code>form.remember.label</code> produces a default "Remember Me" label. Using any other name causes the aforesaid Exception to occur.</p>