I am trying to create a login page on python with flask and psycopg2 using a postgresql database and upon login it should redirect to a page or to registration if the login