This is a project for Udacity's [Full Stack Web Developer Nanodegree]
This is a reporting tool that rints out reports (in plain text) based on the data in the database. This reporting tool is a Python program using the psycopg2 module to connect to the database.
- What are the most popular three articles of all time? Which articles have been accessed the most? Present this information as a sorted list with the most popular article at the top.
- Who are the most popular article authors of all time? That is, when you sum up all of the articles each author has written, which authors get the most page views? Present this as a sorted list with the most popular author at the top.
- On which days did more than 1% of requests lead to errors? The log table includes a column status that indicates the HTTP status code that the news site sent to the user's browser.
Here are the steps to set up the project environment to run it:
- Install Vagrant from https://www.vagrantup.com.
- Install VirtualBox from https://www.virtualbox.org.
- Download the vagrant setup files from https://github.com/udacity/fullstack-nanodegree-vm.
- Download the database from https://d17h27t6h515a5.cloudfront.net/topher/2016/August/57b5f748_newsdata/newsdata.zip
- Put the newsdata.sql file into the vagrant directory.
- Clone or download my project.
- Upzip as needed and copy all files into the vagrant directory.
- Open Terminal and navigate to the project folder.
- cd into the vagrant directory
- Run
vagrant up
to build the VM. - After vagrant is up and running, run
vagrant ssh
. - cd into the project directory:
cd /vagrant
- Load the data using the following command:
psql -d news -f newsdata.sql
- Run
python newsdata.py