So I can run the reCAPTCHA on localhost, but when I load it onto PythonAnywhere, I get an internal server error navigating to the page with the captcha that I cannot figure out. The output from error.log is:
2015-10-03 05:44:24,842 :Exception on /contact [GET]
Traceback (most recent call last):
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/socalnspweb/mysite/flask_app.py", line 114, in contact
return render_template('contact.html', pageTitle="Contact Us", form=form, emails=emails, nth_selected=nSelected)
File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 125, in render_template
context, 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/socalnspweb/mysite/static/templates/contact.html", line 1, in top-level template code
{% extends "header.html" %}
File "/home/socalnspweb/mysite/static/templates/header.html", line 118, in top-level template code
{% block content %}
File "/home/socalnspweb/mysite/static/templates/contact.html", line 70, in block "content"
{{ form.recaptcha }}
File "/usr/local/lib/python2.7/dist-packages/wtforms/fields/core.py", line 131, in __html__
return self()
File "/usr/local/lib/python2.7/dist-packages/wtforms/fields/core.py", line 140, in __call__
return self.widget(self, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/flask_wtf/recaptcha/widgets.py", line 68, in __call__
'visual_challenge': _('Get a visual challenge'),
File "/usr/local/lib/python2.7/dist-packages/flaskext/babel.py", line 456, in gettext
t = get_translations()
File "/usr/local/lib/python2.7/dist-packages/flaskext/babel.py", line 194, in get_translations
translations = support.Translations.load(dirname, [get_locale()])
File "/usr/local/lib/python2.7/dist-packages/flaskext/babel.py", line 209, in get_locale
babel = ctx.app.extensions['babel']
KeyError: 'babel'
Not sure how to interpret this error, as I can import babel through Python in a bash console.