Skip to content

Matmonsen/weather_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather api

A Django powered API for fetching weather forecasts.
Each forecast is cached for 10 minutes.
The forecast from is fetched from Yr

Installation

Prerequisite: Python version >= 3.5 installed

  1. Create folder for project
       mkdir weather_api 
       cd weather_api
  2. Create virtualenvironment
        # Use pip3 if python --version is 2.xx
        pip install venv
        python -m venv .
  3. Activate virtualenv
    1. Unix systems
          source bin/activate
      
    2. Windows
          Scripts/Activate
      
  4. Clone repo
        git clone https://github.com/Matmonsen/weather_api
    
  5. Install dependencies
        cd weather_api
        pip install -r requirements.txt
    
  6. Create tables in sqlite3 database
        python manage.py migrate
    
  7. Start server
        python manage.py runserver
    
  8. Go to browser at http://127.0.0.1:8000/api/search
  9. Specify valid get params
    http://127.0.0.1:8000/api/search/?language=en&forecastType=standard&location=spain/catalonia/barcelona

Development

  1. Github link to Frontend application in react
  2. Github link to Yr api wrapper

License

See license