Simple website built using flask, allowing for checking aviation weather for airports around the world. Uses weather data from NOAA Aviation Weather Center.
-
Clone this repository
-
Install required dependencies
pip install -r requirements.txt
and install metar.py
-
Setup elasticsearch
- Download and install elasticsearch
- Download
airports.csv
from this link and import it into Elasticsearch, setident
,municipality
andname
field types totext
or the search functionality will not work correctly - Set
ELASTICSEARCH_URL
environmental variable - Set
SEARCH_INDEX_NAME
to the name of the index you created while importingairports.csv
-
Set
FLASK_APP
environmental variable toavw
using linuxexport FLASK_APP="avw"
using windows (powershell)
$env:FLASK_APP="avw"
-
Set
SQLALCHEMY_DATABASE_URI
environmental variable to correct SQLite database URI (usesqlite://
for in memory database) -
Set
SECRET_KEY
environmental variable to a randomly generated string. For generation, may usepython -c 'import os; print(os.urandom(16))'
-
Generate necessary tables in the database
Open flask shell withflask shell
and run
from avw import db from avw.models import User db.create_all()
Run the app with
flask run
Run tests with
pytest