nijat / biapp

Microservice boilerplate for Django Rest Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

+++ title = "Service blueprint (Django)" +++

Service blueprint (Django)

Summary

This is a blueprint service written in Django. You should change this summary to describe your service. Some points to address:

  • What feature(s) does this service provide for a Walhall app?
  • What kinds of data models does this service provide for an app?
  • An overview of how the data models work together.

REST data models

[Model 1]

A [model 1] has the following properties:

  • [Property]: One-sentence description of the property.
  • [Property]: One-sentence description of the property.
  • [Property]: One-sentence description of the property.

Endpoints

  • GET /{model1}/{property}/: Retrieves a ____.
  • POST /{model1}/{property}/: Creates a ____.
  • PATCH /{model1}/{property}/: Updates a ____.
  • DELETE /{model1}/{property}/: Deletes a ____.

Click here for the full API documentation.

[Model 2]

A [model 2] has the following properties:

  • [Property]: One-sentence description of the property.
  • [Property]: One-sentence description of the property.
  • [Property]: One-sentence description of the property.

Endpoints

  • GET /{model2}/{property}/: Retrieves a ____.
  • POST /{model2}/{property}/: Creates a ____.
  • PATCH /{model2}/{property}/: Updates a ____.
  • DELETE /{model2}/{property}/: Deletes a ____.

Click here for the full API documentation.

Non-REST endpoints

This is a section where you would document endpoints that are not related to a data model, e.g., with the search service.

For each of these endpoints, a more in-depth explanation is necessary.

Local development

Here are some instructions for developing this service locally:

Prerequisites

You must have Docker installed.

Build & run service locally

Build the Docker image:

docker-compose build

Run a web server with this service:

docker-compose up

Now, open your browser and go to http://localhost:8080.

For the admin panel, go to http://localhost:8080/admin (user: admin, password: admin).

Run tests

To run the tests once:

docker-compose run --rm --entrypoint 'bash scripts/run-tests.sh' {name-of-service}

To run the tests and leave bash open inside the container so that it's possible to re-run the tests faster again using bash scripts/run-tests.sh [--keepdb]:

docker-compose run --rm --entrypoint 'bash scripts/run-tests.sh --bash-on-finish' {name-of-service}

To run bash:

docker-compose run --rm --entrypoint 'bash' {name-of-service}

API documentation (Swagger)

Click here to go to the full API documentation.

License

Copyright ©2019 Humanitec GmbH.

This code is released under the Humanitec Affero GPL.

About

Microservice boilerplate for Django Rest Framework

License:Other


Languages

Language:Python 47.7%Language:HTML 25.0%Language:Shell 24.3%Language:Dockerfile 2.9%