I know this might be really a simple question but I don\'t know the solution. What is happening here when I try to connect to postgresql? I am self learner in this field of
Yes, psycopg2 are basically the Python drivers for PostgreSQL that need to be installed separately.
A list of valid connection strings can be found here, yours is a bit off (you need to the username, the password and hostname as specified in the link below):
http://docs.sqlalchemy.org/en/latest/core/engines.html#postgresql