Hi,
I have a python / flask app that works fine on a local machine though when deploying via PA I'm receiving the following error:
ValueError: too many values to unpack (expected 2)
The only line of code referenced in the error is: <td>{{ render_field(form.asset_category) }}</td> which on the local machine returns the single item from a list perfectly fine.
Any help is appreciated.
Full Traceback:
Traceback (most recent call last): File "/usr/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/usr/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functionsrule.endpoint File "/home/chrisbradd/lenders/flask_app.py", line 28, in index return render_template('first_app.html', form=form) File "/usr/lib/python3.7/site-packages/flask/templating.py", line 140, in render_template ctx.app, File "/usr/lib/python3.7/site-packages/flask/templating.py", line 120, in _render rv = template.render(context) File "/usr/lib/python3.7/site-packages/jinja2/asyncsupport.py", line 76, in render return original_render(self, args, kwargs) File "/usr/lib/python3.7/site-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/usr/lib/python3.7/site-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3.7/site-packages/jinja2/_compat.py", line 37, in reraise raise value.with_traceback(tb) File "/home/chrisbradd/lenders/templates/first_app.html", line 70, in top-level template code <td>{{ render_field(form.asset_category) }}</td> File "/usr/lib/python3.7/site-packages/jinja2/runtime.py", line 574, in _invoke rv = self._func(arguments) File "/home/chrisbradd/lenders/templates/_formhelpers.html", line 21, in macro File "/usr/lib/python3.7/site-packages/jinja2/runtime.py", line 262, in call return obj(args, kwargs) File "/usr/lib/python3.7/site-packages/wtforms/fields/core.py", line 155, in call return self.meta.render_field(self, kwargs) File "/usr/lib/python3.7/site-packages/wtforms/meta.py", line 56, in render_field return field.widget(field, *render_kw) File "/usr/lib/python3.7/site-packages/wtforms/widgets/core.py", line 323, in __call for val, label, selected in field.iter_choices(): File "/usr/lib/python3.7/site-packages/wtforms/fields/core.py", line 454, in iter_choices for value, label in self.choices: ValueError: too many values to unpack (expected 2)