'Covid-19 Overview' is a Python Flask student project for "Internet Technologies" course of department of Informatics - Ionian University, made by Pashalis Grivas and Nemanja Jevtić. The main goal of this project is to demonstrate the usage of Flask web framework by building a simple application/website with an interesting topic - Covid-19 virus.
The app fetches " COVID-19 cases worldwide " (JSON) dataset with Covid-19 data from EU Open Data Portal.
- watch global total cases and deaths (until current day)
- track total cases and deaths by continent (until current day)
- be informed about total cases and deaths of all countries (until current day)
- track cases and deaths for a specific country between two dates
- compare cases and deaths of two countries between two dates
- see the top N countries with the most cases/deaths for a specific N (until current day)
- watch the virus spread percentage per country (until current day).
-
Run
git clone (url of the repository)
into a directory in order to download the project. -
Install python dependencies (Install Python 3 if you haven't)
pip3 install Flask
(just pip on Windows)pip3 install mysql-connector-python
pip3 install requests
-
Create a user account in your mysql server with: (use xampp with phpadmin or install mysql on your system)
- username: user1
- password: user1
- host name (local): localhost
- all data & structure rights
Or change the
host
,user
andpasswd
arguments in 'create_database.py' and 'json_to_database.py' files to match your server credentials. -
Start your mysql server. (if you already haven't)
-
Run the 'main.py' with:
python3 main.py
command (it takes a while the first time...)
-
Open site with your browser using the following address:
-
Html date input is not supported in Safari or Internet Explorer 11 (or earlier).
-
FIX ERROR (if raised):
"SELECT list is not in GROUP BY clause and contains nonaggregated column … incompatible with sql_mode=only_full_group_by"
by running:
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
command on your mysql server.
-
Connect to mysql as root:
sudo mysql -h localhost -u root
-
Create user running:
- mysql>
CREATE USER 'user1'@'localhost' IDENTIFIED BY 'user1';
- mysql>
-
If ERROR 1819 (HY000) run:
- mysql>
SET GLOBAL validate_password_policy=LOW;
and run again step 2.
Remember to reset this value after you're done.
- mysql>
-
Give privileges to the user:
- mysql>
GRANT ALL PRIVILEGES ON * . * TO 'user1'@'localhost';
- mysql>
-
Run:
- mysql>
FLUSH PRIVILAGES;
to reload privileges.
- mysql>
-
Log out:
- mysql>
quit
- mysql>
-
Connect as the new user (test):
mysql -u user1 -p user1