Skip to content

stigito/django-weather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Weather App

Application

Prerequisites

pipenv install django
pipenv install djangorestframework
pipenv install openmeteo-requests
pipenv install requests-cache retry-requests numpy pandas
pipenv install psycopg2

Usage

python manage.py migrate
python manage.py runserver

Query

get meteo data

curl -X GET http://127.0.0.1:8000/api/meteo/get/

get data

curl -X GET http://127.0.0.1:8000/api/daytemp/read/1104

curl -X GET http://127.0.0.1:8000/api/daytemp/list/

create data

curl -X POST http://127.0.0.1:8000/api/daytemp/create/ -d '{"date": "1971-01-01", "temp": 1.23}' -H "Content-Type: application/json"

curl -X POST http://127.0.0.1:8000/api/daytemp/create/ -d '[{"date": "1971-01-01", "temp": 1.23}]' -H "Content-Type: application/json"

update data

curl -X PUT http://127.0.0.1:8000/api/daytemp/update/123 -d '{"date": "1971-01-01", "temp": 1.23}' -H "Content-Type: application/json"

delete data

curl -X DELETE http://127.0.0.1:8000/api/daytemp/delete/123

delete all

curl -X DELETE http://127.0.0.1:8000/api/daytemp/delete/0

Build Docker

in weather app directory:

pip freeze -l > requirements.txt
docker build -t stigito/django-weather:1.0 .

Ansible

ansible-playbook -i inventories/local setup.yml --diff --check
ansible-playbook -i inventories/local start.yml --diff --check
ansible-playbook -i inventories/local stop.yml --diff --check

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published