title: Jinja2 Exceptions - Cannot find attribute
body: <p>Working on a problem in Flask/ Python. Had a few of these errors pop up and I've been able to squash them as they arise; however, this one I cannot seem to get to the bottom of.</p>
  
  <p>I have a simple form which allows users to login.</p>
  
  <p>But each time I load the page I am greeted with this error:</p>
  
  <p><strong>jinja2.exceptions.UndefinedError: 'shop.forms.LoginForm object' has no attribute 'submit'</strong></p>
  
  <p>Below is the code that I am working with, thanks in advance.</p>
  
  <p>p.s. I have seen similar posts regarding the hidden_tag() attribute, but the fixes suggested are not working for this scenario.</p>
  
  <h1>routes.py</h1>
  
  <pre><code>import os
  from flask import render_template, url_for, request, redirect, flash
  from shop import app, db
  from shop.models import Author, Book, User
  from shop.forms import RegistrationForm, LoginForm
  from flask_login import login_user, current_user, logout_user, login_required
  
  
  @app.route("/login", methods=['GET', 'POST'])
  def login():
  form = LoginForm()
  if request.method == 'POST':
      user = User.query.filter_by(email=form.email.data).first()
      if user is not None and user.verify_password(form.password.data):
          login_user(user)
          return redirect(url_for('home'))
  return render_template('login.html', title='Login', form=form)
  </code></pre>
  
  <h1>forms.py</h1>
  
  <pre><code>from flask_wtf import FlaskForm
  from wtforms import StringField, PasswordField, SubmitField, BooleanField
  from wtforms.validators import DataRequired, Length, Email, EqualTo
  
  class LoginForm(FlaskForm):
  email = StringField('Email', validators=[DataRequired(), Email()])
  password = PasswordField('Password', validators=[DataRequired()])
  sumbit = SubmitField('Login')
  </code></pre>
  
  <h1>login.html</h1>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Login&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
  
  {% extends "layout.html" %}
  {% block content %}
  
  &lt;form method="POST" action=""&gt;
      {{ form.csrf_token }}
      &lt;div class=""&gt;
          {{ form.email.label }} {{ form.email}}
      &lt;/div&gt;
      &lt;div class=""&gt;
      {{ form.password.label }} {{ form.password}}
      &lt;/div&gt;
      &lt;div class=""&gt;
          {{ form.submit() }}
      &lt;/div&gt;
  &lt;/form&gt;
  
  {% endblock content %}
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>EDIT: Removing the () from submit doesn't solve the issue. Just removes the instance of the button entirely from the template. See below:</p>
  
  <p><a href="https://i.stack.imgur.com/drSR4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/drSR4.png" alt="Screenshot of form on website."></a></p>