Today I started using PythonAnywhere and am trying to get my app to run for the first time. I'm seeing an internal server error, and the log has a AttributeError: 'list' object has no attribute 'file_allowed' (see below).
I do not know Why I getting this error. Please help me to understand this problem.
Thanks.
2016-07-15 16:57:08,205 :Exception on /new_post [POST]
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 "/usr/local/lib/python2.7/dist-packages/flask_login.py", line 515, in decorated_view
return fn(*args, **kwargs)
File "/home/shuvanon/mysite/app.py", line 91, in post
if form.validate_on_submit():
File "/usr/local/lib/python2.7/dist-packages/flask_wtf/form.py", line 125, in validate_on_submit
return self.is_submitted() and self.validate()
File "/usr/local/lib/python2.7/dist-packages/wtforms/form.py", line 265, in validate
return super(Form, self).validate(extra)
File "/usr/local/lib/python2.7/dist-packages/wtforms/form.py", line 130, in validate
if not field.validate(self, extra):
File "/usr/local/lib/python2.7/dist-packages/wtforms/fields/core.py", line 176, in validate
stop_validation = self._run_validation_chain(form, chain)
File "/usr/local/lib/python2.7/dist-packages/wtforms/fields/core.py", line 196, in _run_validation_chain
validator(form, self)
File "/usr/local/lib/python2.7/dist-packages/flask_wtf/file.py", line 69, in __call__
if not self.upload_set.file_allowed(field.data, field.data.filename):
AttributeError: 'list' object has no attribute 'file_allowed'