import psycopg2
connection = None
def get_cursor():
global connection
if connection is None:
connection = psycopg2.connect(database="postgres", user="postgres", password="not_admin", host="serafimdev.com", port=6000)
return connection.cursor()