Skip to content

marcoaal/melp-project

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published