title: jinja2.exceptions.UndefinedError 'form' is undefined in Python Flask
body: <p>I am making an application on Google app engine using Python Flask and I am new to Python Flask , learning new things everyday. I am using the jinja2 template with flask it works fine on all the pages but it does not recognize 
  <code>{{ form.hidden_tag() }}</code> 
  in my signup page for users and throws an exception</p>
  
  <p><code>jinja2.exceptions.UndefinedError</code></p>
  
  <p>Here is my Signup.html code</p>
  
  <pre><code>    `&lt;!-- This is my page --&gt;
      {% extends "base.html" %}
      {% block title %} Sign up | Eventus {% endblock %}
      {% block style_block %}
          &lt;link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet"&gt; 
          &lt;link href="{{ url_for('static', filename='bootstrap/css/social-buttons.css') }}" rel="stylesheet"&gt;  
  {% endblock %}
  {% block content %}
      &lt;div class="container theme-showcase"&gt;
      &lt;div class="row"&gt;
  
  
              &lt;h3&gt;&lt;center&gt;Sign Up Uscore&lt;/center&gt;&lt;/h3&gt;&lt;br&gt;&lt;br&gt;
          &lt;div class="col-sm-6"&gt;
              &lt;form id="signup" class="navbar-form form-inline" action="{{ url_for('signup_action') }}" method="post" &gt;
  
                  &lt;fieldset&gt;
                  {{ form.hidden_tag() }}
                  &lt;div class="control-group"&gt;
                      &lt;div class="control-label"&gt;{{ form.example_name.label }}&lt;/div&gt;
                      &lt;div class="controls"&gt;
                          {{ form.example_name|safe }}
                          {% if form.example_name.errors %}
                          &lt;ul class="errors"&gt;
                              {% for error in form.example_name.errors %}
                              &lt;li&gt;{{ error }}&lt;/li&gt;
                              {% endfor %}
                          &lt;/ul&gt;
                          {% endif %}
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="control-group"&gt;
                      &lt;div class="control-label"&gt;{{ form.example_description.label }}&lt;/div&gt;
                      &lt;div class="controls"&gt;
                          {{ form.example_description|safe }}
                          {% if form.example_description.errors %}
                          &lt;ul class="errors"&gt;
                              {% for error in form.example_description.errors %}
                              &lt;li&gt;{{ error }}&lt;/li&gt;
                              {% endfor %}
                          &lt;/ul&gt;
                          {% endif %}
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="control-group"&gt;
                      &lt;div class="controls"&gt;
                          &lt;input class="btn btn-primary" type="submit" value="Add Example"/&gt;
                          &lt;button class="btn" data-dismiss="modal"&gt;Cancel&lt;/button&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;/fieldset&gt;
  
  
                  &lt;!-- &lt;input type="text" name="username" value="{{username}}" placeholder="your username" class="form-control"&gt;&lt;/input&gt;&lt;br&gt;&lt;br&gt;
                  &lt;input type="text" name="email" value="{{email}}" placeholder="your email" class="form-control"&gt;&lt;/input&gt;&lt;br&gt;&lt;br&gt;
                  &lt;input type="password" name="password" value="{{password}}" placeholder="your password" class="form-control"&gt;&lt;/input&gt;&lt;br&gt;&lt;br&gt;
                  &lt;input type="password" name="confpassword" value="" placeholder="retype password" class="form-control" /&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
                  &lt;input type="checkbox" name="remember" value="" class="form-control" style="width: 15px; height: 12px;"/&gt; Remember me
                  &lt;a href="" class="pull-right"&gt;forgot password&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt; 
                  &lt;input type="submit" name="signup_submit" value"Sign Up" class="btn btn-success" /&gt;
                  Already a Member&lt;a href="" &gt; Sign in &lt;/a&gt; --&gt; 
  
              &lt;/form&gt;
  
  
  
          &lt;/div&gt;
          &lt;div class="col-sm-1"&gt;
          &lt;/div&gt;
          &lt;div class="col-sm-5"&gt;
              &lt;a class="btn btn-block btn-lg btn-google-plus" href="/signin/google/"&gt;
                  &lt;i class="icon icon-google-plus"&gt;&lt;/i&gt;
                      Sign in with Google
          &lt;/a&gt;    
          &lt;a class="btn btn-block btn-lg btn-google-plus" href="/signin/googleoauth/"&gt;
                  &lt;i class="icon icon-google-plus"&gt;&lt;/i&gt;
                      Sign in with Google plus
          &lt;/a&gt;    
              &lt;a class="btn btn-block btn-lg btn-facebook" href="/signin/facebook/"&gt;
                  &lt;i class="icon icon-facebook"&gt;&lt;/i&gt;
                      Sign in with Facebook
          &lt;/a&gt;    
          &lt;a class="btn btn-block btn-lg btn-twitter" href="/signin/twitter/"&gt;
                  &lt;i class="icon icon-twitter"&gt;&lt;/i&gt;
                      Sign in with Twitter
          &lt;/a&gt;    
  
  
          &lt;/div&gt;
  
  
      &lt;/div&gt;
  
  
      &lt;/div&gt;
  
  
  {% endblock %}
  </code></pre>
  
  <p>Here is the Error I get on my page</p>
  
  <pre><code>jinja2.exceptions.UndefinedError
  UndefinedError: 'form' is undefined
  
  Traceback (most recent call last)
  File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-production/uscore/src/lib/flask/app.py", line 1820, in wsgi_app
  response = self.make_response(self.handle_exception(e))
  File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-production/uscore/src/lib/flask/app.py", line 1403, in handle_exception
  reraise(exc_type, exc_value, tb)
  File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-production/uscore/src/lib/flask/app.py", line 1817, in wsgi_app
  response = self.full_dispatch_request()
  File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-production/uscore/src/lib/flask/app.py", line 1477, in full_dispatch_request
  rv = self.handle_user_exception(e)
  File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-production/uscore/src/lib/flask/app.py", line 1381, in handle_user_exception
  reraise(exc_type, exc_value, tb)
  File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-production/uscore/src/lib/flask/app.py", line 1475, in full_dispatch_request
  rv = self.dispatch_request()
  File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-production/uscore/src/lib/flask_debugtoolbar/__init__.py", line 101, in dispatch_request
  return view_func(**req.view_args)
  File "/usr/lib/python2.7/cProfile.py", line 149, in runcall
  return func(*args, **kw)
  File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-production/uscore/src/lib/flask/views.py", line 84, in view
  return self.dispatch_request(*args, **kwargs)
  File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-production/uscore/src/lib/flask/views.py", line 149, in dispatch_request
  return meth(*args, **kwargs)
  File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-production/uscore/src/application/views.py", line 154, in get
  return flask.render_template('signup.html')
  File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-production/uscore/src/lib/flask/templating.py", line 128, in render_template
  context, ctx.app)
  File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-production/uscore/src/lib/flask/templating.py", line 110, in _render
  rv = template.render(context)
  File "/home/chitrank/Documents/Google_App_Engine/flask_vir/google_appengine/lib/jinja2-2.6/jinja2/environment.py", line 894, in render
  return self.environment.handle_exception(exc_info, True)
  File "/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-production/uscore/src/application/templates/signup.html", line 1, in top-level template code
  {% extends "base.html" %}
  UndefinedError: 'form' is undefined
  </code></pre>
  
  <p>Please let me know where I am writing the code wrong, do I need to make a seaperate file for social login or I need to do some settings as per google app engine.</p>