This Python project connects to a PostgreSQL database and runs analyses of the news website logs in to answer three questions. I've created this program as part of the Full Stack Web Developer Nanodegree.
-
You'll need to download the Vagrant configuration Udacity has provided, and must have Vagrant and VirtualBox set up on your system.
-
From the
vagrant
directory, runvagrant up
to setup the virtual machine. -
Fork, clone or download this repository into the
vagrant
directory. -
Download and unzip the script to generate the data and save the file in the
vagrant
directory. -
Now you're ready to connect to the virtual machine and setup the database:
-
vagrant ssh
-
cd /vagrant
(and if you put the files into a subdirectory,cd
to it) -
psql -d news -f newsdata.sql
-
-
You can explore the database using
psql -d news
if you want to check out its structure and contents. -
Run
python3 logs_analysis.py
to execute and output the analysis.