Skip to content

Latest commit

 

History

History
65 lines (57 loc) · 1.69 KB

README.md

File metadata and controls

65 lines (57 loc) · 1.69 KB

Melp Project

REST API built in Django with PostGis

Why Django

Django is the most famous and supported python web framework, is focused on reducing the development time, is compatible with major operating systems and easy to extend and scale.

Requirements

For Dockerized app

  • Docker >= 19.03
  • Docker Compose >= 1.26

Usage

For dockerized app the service will run in "127.0.0.1:8000"

For Dockerized app

First run the cointainer for the db

docker-compose up --build -d db

After the db service is ready, then run the container for the web service

docker-compose up --build -d web

(Optional) List all running Docker containers to verify the success of the building

docker ps

Then create the database migrations and populate with the initial data

docker-compose exec web python manage.py migrate

Heroku Deployment

In the Heroku dashboard create an app and attach it the Heroku Postgres add-on, then by the Heroku CLI run the commands below:

CLI Login

heroku login

Postgres configuration

heroku pg:psql -a <app_name>
=> CREATE EXTENSION postgis;
=> SELECT postgis_version();
=> \q

Docker

heroku container:login
heroku container:push web -a <app_name>
heroku container:release web -a <app_name>

Migrate the data to Postgres

heroku run python manage.py makemigrations -a <app_name>
heroku run python manage.py migrate -a <app_name>

Postman Collection

In the 'postman' folder there are the collection and environment files for make some requests to testing the API REST

API Documentantion

Postman API documentantion