This project uses a PostgreSQL database to analyse data from a fictional news site.
These instructions will get you a copy of the project up and running on in a virtual environment.
- Python 3.6
- Vagrant
- VirtualBox
- SQL database file in /news folder. File can be found here
Installation instructions for Vagrant and VirtualBox can be found in the Built With section below
Initialise virtual environment
From your terminal, type:
vagrant up
When finished, ssh into your virtual environment:
vagrant ssh
cd /vagrant
Initialise database
psql -d news -f news/newsdata.sql
In your virtual environment:
psql -d news
Type in the following SQL command:
CREATE VIEW articlelogs AS
SELECT author, title FROM log as l
JOIN articles as a
ON l.path LIKE concat('/article/',a.slug);
In your virtual environment:
cd news
python3.6 news_log.py
- Lasse Alsbirk