UD-Logfilter is a filter for database log. It uses psycopg2 to query a mock PostgreSQL database for a fictional news website.
Set up the vagrant, use the Vagrantfile provided
Download data
and unzip into the vagrant dir
In vagrant terminal, load data by : psql -d news -f newsdata.sql
In vagrant terminal, pupular views by using this command:
psql -d news -f create_views.sql
In vargant termianl:
- To display the three most viewed articles in the news database, run:
python3 most_popular_three_article.py
- To display the most popular article authors of all time, run:
pyhton3 most_popular_author.py
- To display on which days did more than 1% of requests lead to errors run:
python3 error_ratio.py