A Django powered API for fetching weather forecasts.
Each forecast is cached for 10 minutes.
The forecast from is fetched from Yr
Prerequisite: Python version >= 3.5 installed
- Create folder for project
mkdir weather_api cd weather_api
- Create virtualenvironment
# Use pip3 if python --version is 2.xx pip install venv python -m venv .
- Activate virtualenv
- Unix systems
source bin/activate
- Windows
Scripts/Activate
- Unix systems
- Clone repo
git clone https://github.com/Matmonsen/weather_api
- Install dependencies
cd weather_api pip install -r requirements.txt
- Create tables in sqlite3 database
python manage.py migrate
- Start server
python manage.py runserver
- Go to browser at http://127.0.0.1:8000/api/search
- Specify valid get params
http://127.0.0.1:8000/api/search/?language=en&forecastType=standard&location=spain/catalonia/barcelona
See license