This project is submitted for Udacity Full-Stack Web Developer Project 3 - Log Analysis.
The python 3 code work with mock PostgreSQL database that could have come from a real-world web application, with fields representing information that a web server would record, such as HTTP status codes and URL paths. The web server and the reporting tool both connect to the same database, allowing information to flow from the web server into the report.
-
Requirements
- Python3
- PostgreSQL
- psycopg2
-
Porject files
loganalysis.py
README.md
-
SQL views
topauthors
create view topauthors as select articles.author, count(log.path) as clickcount FROM articles left join log on log.path like concat('%',articles.slug,'%') group by articles.author order by clickcount desc
-
Load newsdata.sql using command
psql -d news -f newsdata.sql
- The sql file could also be found here
-
Excute python script loganalysis.py
-
Using the Terminal:
- Type
python3 loganalysis.py
or./logsanalysis.py
- Type
-
Using the Python IDLE:
-
Select Run from the IDLE menu,
-
Click
Run Module
from the dropdown list
-
-