API-Imperfect / geodjango-hospitals-api

A GIS based REST API built with Django, Docker, Nginx, Django Rest Framework and more.... 🐍 πŸ”₯

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Intro to spatial and non Spatial Queries

Twitter: AlphaOmondi

πŸ‘‹ Intro series on Spatial querying with Geodjango and Django REST Framework.

Run the Application

git clone https://github.com/API-Imperfect/geodjango-hospitals-api
cd geodjango-hospitals-api
 - run the command: make build
 - run the migrate command: make migrate
 - create superuser: make superuser
 - then run the command: make shell
to load hospital data run these commands in the shell
>>> from hospitals import load
>>> load.run()

to load boundaries data run these commands
>>> from boundaries import load
>>> load.run()
>>> quit()

πŸƒπŸ½β€β™‚οΈ API Requests
Open Postman and make the following get requests
GET http://localhost:8080/api/v1/hospitals/
GET http://localhost:8080/api/v1/boundaries/
GET http://localhost:8080/api/v1/hospitals/?province=1
GET http://localhost:8080/api/v1/hospitals/closest_hospitals/?lon=30.094388&lat=-1.943566
GET http://localhost:8080/api/v1/hospitals/total_bed_capacity/
GET http://localhost:8080/api/v1/hospitals/province_beds_capacity/

License

MIT

About

A GIS based REST API built with Django, Docker, Nginx, Django Rest Framework and more.... 🐍 πŸ”₯

License:MIT License


Languages

Language:Python 95.6%Language:Makefile 3.7%Language:Shell 0.7%