Python code to make connection with the database