I am trying to import the books.csv file into the online PostgreSQL database via Python code, as shown in the lectures and I get this error message when sqlalchemy is attempting to create the engine. I have substituted the "DATABASE_URL" in the code with the correct url of the database.
This also happens when trying to run any of the Python files provided in the course. When connecting directly to the database with the psql URL command, I can run any query and manipulate the tables.
As per project instructions, this error message occurs when not setting the DATABASE_URL environment variable to be the URI of the database, although related to running flask. The variable is set (I have checked for the environment variables). What am I missing?
Thank you in advance for any help.
psql $DATABASE_URL
work?os.getenv
?os.getenv
. I completely overlooked the point of using it. Well, better late than never. Thank you for taking the time to look into this.DATABASE_URL
...