Python: werkzeug.exceptions.InternalServerError: 500 Internal Server Error: 'NoneType' object is not iterable Python: werkzeug.exceptions.InternalServerError: 500 Internal Server Error: 'NoneType' object is not iterable flask flask

Python: werkzeug.exceptions.InternalServerError: 500 Internal Server Error: 'NoneType' object is not iterable


You are not setting the format parameter when executing the function and therefore it's always True (as you stablished in the function definition).

The response when you successfully insert something in the PgSQL DB is None and it's not possible to String format a NoneType Object.

Just use the code above and you will be fine.

self.pgsql.execute_query(query, format=False).