I am trying to set up a PostgreSQL database for my django project, which I believe I have done now thanks to the replies to my last question Problems setting up a postgreSQL
I used the extension after only importing psycopg2:
import psycopg2 ... psycopg2.extensions.AsIs(anap[i])