Best practice on calling external database?

Another thought - I’ve not tried this, but have you tried psycopg’s RealDictCursor rather than just DictCursor?

RealDictCursor uses an actual Python dict and so should be serialisable by default. DictCursor just provides a dictionary-like interface.

1 Like