Don't really know how this can be wrong because I'm literally copying along with a coding video but here we are. Says the first arg must be a psycopg2.extension.connection instead of a string?? its not on the documentation nor the guide.
try:
conn = psycopg2.connect(dbname= 'fastapi', host= 'localhost' , port= 5432 , user = 'postgres', password= 'ninjagaiden',connection_factory= RealDictCursor )
cur = conn.cursor()
print('database connection succesful')
except Exception as error :
print("connection failed")
print("error explanation:", error)