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.txtand install metar.py
-
Setup elasticsearch
- Download and install elasticsearch
- Download
airports.csvfrom this link and import it into Elasticsearch, setident,municipalityandnamefield types totextor the search functionality will not work correctly - Set
ELASTICSEARCH_URLenvironmental variable - Set
SEARCH_INDEX_NAMEto the name of the index you created while importingairports.csv
-
Set
FLASK_APPenvironmental variable toavw
using linuxexport FLASK_APP="avw"
using windows (powershell)
$env:FLASK_APP="avw"
-
Set
SQLALCHEMY_DATABASE_URIenvironmental variable to correct SQLite database URI (usesqlite://for in memory database) -
Set
SECRET_KEYenvironmental 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 shelland run
from avw import db from avw.models import User db.create_all()
Run the app with
flask run
Run tests with
pytest