Forums

wtforms error

Hi,

I'm having trouble getting my site to work. It runs fine on my local host but I'm getting an error from my index.html oddly enough. Here is the error I get from my error log. You have my approval to take a look at my code if you need to.

Thanks!

2016-10-20 18:18:20,889 :Error running WSGI application
Traceback (most recent call last):
  File "/bin/user_wsgi_wrapper.py", line 154, in __call__ app_iterator = self.app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1701, in __call__ return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1689, in wsgi_app response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1687, in wsgi_app response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1360, in full_dispatch_request rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1358, in full_dispatch_request rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1344, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/sqeekypotato/whiteCollar/flask_app.py", line 14, in index return render_template("index.html")
  File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 125, in render_templatecontext, ctx.app)
  File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 107, in _render rv = template.render(context)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 969, in render return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 742, in handle_exception reraise(exc_type, exc_value, tb)
  File "/home/sqeekypotato/whiteCollar/templates/index.html", line 333, in top-level template code {{ form.name(class="form-control") }}
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 397, in getattr return getattr(obj, attribute)
UndefinedError: 'form' is undefined

[edited by admin: formatting]

seems like in your index.html template, you have something called {{ form.name(class="form-control") }}, and it doesn't recognized form. Did you pass it into the template?