The python script included in this project performs a mock query to a database for a fictional news website. It uses psycopg2 to send PostgreSQL queries to the database. The database includes a list of articles, along with their urls and author IDs; a list of authors; and a logs table which logs every connection to the website as well as its status.
These instructions will get you a copy of the project up and running on your local machine.
You will need to install/download the following prior to running this software:
Download the database here: LogsDatabase
Then extract the database into the root folder of this project (this is wherever you saved this project on your local machine).
Run your vagrant machine using the Vagrantfile provided with the project. This process can take a while.
vagrant up
Inside of the virtual machine navigate to
cd /vagrant
Once there, run the following command to add the SQL database to your virtual machine:
psql -d news -f newsdata.sql
Once the database is installed, run the folloing command to produce a report:
python report.py
That's it! Once the program appears to be finished, check the log.txt file.
- Python2 - Programming Language Used
- PostgreSQL - Database Language
- Mateusz Lipski - Initial work - PortalFl0w