Skip to content

pratikdaigavane/django-rest-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django REST Starter

Django Lint and Build

A starter template for building REST APIs in Django

Features

  • User Management APIs
  • API Documentation using swagger
  • Integration with Django Rest Framework
  • JWT Authentication
  • Django Debug Toolbar
  • PostgreSQL and Redis integrated out of the box.
  • Containerized using Docker and managed using Docker Compose
  • Pipeline to Test and Build docker image

Prerequisites

This project is built on top of docker containers. So ensure that you have Docker and Docker Compose installed on your system For installation instructions refer: https://docs.docker.com/install/

Running unit test cases

  • This project follows TDD(Test Drive Development) style.
  • Flake8 is used as primary linter for the project

To run test cases:

docker-compose run app sh -c "python manage.py test && flake8"

Starting the Server

Start PostgreSQL and Redis first:

docker-compose up -d db redis

Then start whole project:

docker-compose up

Execute Commands

To execute any commands inside django docker container, follow this format:

docker-compose run app sh -c "command here"

Examples

  • Create Super User:

    docker-compose run app sh -c "python manage.py create superuser"

  • Add New App:

    docker-compose run app sh -c "python manage.py startapp polls"

API Documentation

API documentation is done using swagger visit /swagger for API documentation

About

A starter template for building REST APIs in Django

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages