By Vinicius Conceição
This is an internal reporting tool that will use information from the database to discover what kind of articles the site's readers like. This tool runs in the terminal.
1. What are the most popular three articles of all time?
2. Who are the most popular article authors of all time?
3. On which days did more than 1% of requests lead to errors?
- Python 2.X
- Vagrant
- Virtual Box
-
You can download and unzip this file: FSND-Virtual-Machine.zip This will give you a directory called FSND-Virtual-Machine. Or, you can use Github to fork and clone the repository https://github.com/udacity/fullstack-nanodegree-vm.
-
Access the new directory created with your terminal
-
Navigate to the directory vagrant using the command:
cd /vagrant
-
Inside the vagrant subdirectory, run the command
vagrant up
. This will configure and set the virtual machine to be ready for use. -
At this point, you can run
vagrant ssh
to log in the VM. -
With the VM up and running, go back to your browser and download the news data that you will be using in the project.
-
Set the directory for the downloaded file or copy and unzip it to the VM directory FSND-Virtual-Machine\vagrant
-
Back to the terminal, you can now import the news data that you downloaded running the command
psql -d news -f newsdata.sql
-
To test the database, type the command
\dt
- to lists the tables that are available in the database.- To exit the database, type the command
\q
- To exit the database, type the command
Don't close the the terminal yet...
-
Download the project zip file to your computer OR Clone this repository to your computer
-
Copy or Move the file/folder of the project to the VM directory FSND-Virtual-Machine/vagrant.
-
Back to the virtual machine terminal that you opened before.
-
Navigate to the project directory and type in the following command:
python log_database.py
There is a file with the output of the report called output.txt