-
Clone this repository
git clone https://github.com/navijo/FlOYBD.git
-
Go inside the newly created folder
cd FlOYBD
-
Create virtualenv with python3
virtualenv -p python3 <"VIRTUALENV FOLDER">
-
Install system requirements with apt
sudo apt install python-numpy python3-dev
-
Activate Virtual Env
source <"VIRTUALENV FOLDER">/bin/activate
-
Install requirements
pip3 install -r <"VIRTUALENV FOLDER">/requirementsDjango.txt
- Wait (it could take some time compiling the sources)
-
Do Django migration
- Edit Django/mysite/floybd/urls.py and comment these lines (the last ones from the file):
startup_clean() createDefaultSettingsObjects() sendLogos()
* Go to Django/mysite and execute:
python manage.py makemigrations
python manage.py migrate
python manage.py migrate --run-syncdb
* Edit Django/mysite/floybd/urls.py and uncomment the previously commented lines
- Create Django superuser
python manage.py createsuperuser
- Run Django
- Go to project root and execute:
bash startDjango.sh (optionally pass the LG IP)
- Go to http://YOUR_IP:8000
- Import Meteorological Stations
- Go to the left menu "More" and click "Settings"
- Enter your previously created credentials
- Go to Stations on the left menu and click the top button "Import Stations"
- Crontab Jobs
- In order to generate automatic KMLs for demo purposes, add the following cronjob to cron to generate every monday at 00:00 a weather KML,a KML of the latest week earthquakes, another one with the heatmap of the latest week earthquakes and a GTFS demo KML.
0 0 * * 1 cd ~/FlOYBD; bash cronDjangoTask.sh
-
Activate Virtual Env
source <"VIRTUALENV FOLDER">/bin/activate
-
Install requirements
pip3 install -r <"VIRTUALENV FOLDER">/requirementsFlask.txt
-
Activate Virtual Env
source <"VIRTUALENV FOLDER">/bin/activate
-
Install requirements
pip3 install -r <"VIRTUALENV FOLDER">/requirementsDataMining.txt
-
Add Cronjobs to fetch new data automatically Add the following cronjobs to crontab
- To get weekly the past week weather info:
0 1 * * 1 cd <WHATEVER>/FlOYBD/ScriptsLaunchers && bash gather.sh
- To clean the past week weather info:
0 2 * * 1 cd <WHATEVER>/FlOYBD/ScriptsLaunchers && bash clean.sh
- To calculate new stats with the past week weather info:
30 4 * * 1 cd <WHATEVER>/FlOYBD/ScriptsLaunchers && bash weatherFunctions.sh
- To fetch daily the new earthquakes data:
30 5 * * * cd <WHATEVER>/FlOYBD/ScriptsLaunchers && bash launchEarthquakes.sh
- To retrain weekly the Linear Regression models with the new weather data:
0 6 * * 1 cd <WHATEVER>/FlOYBD/ScriptsLaunchers && bash launchPredictions.sh