An open API service indexing awesome lists of open source software.

https://github.com/smoke-trees/django-template

An opinionated template for quickly getting started with a django webapp
https://github.com/smoke-trees/django-template

django django-rest-framework docker docker-compose nginx openapi rest-api swagger template

Last synced: about 1 month ago
JSON representation

An opinionated template for quickly getting started with a django webapp

Awesome Lists containing this project

README

        

# Django template
An opinionated template for quickly bootstrapping a django project using postgres, docker and nginx.

## Features
- [x] Everything Django offers OOTB
- [x] CORS support
- [x] Autogenerated OpenAPI and ReDoc API documentation
- [x] Production deployment using docker-compose
- [x] SSL using Nginx and LetsEncrypt


## Instructions to run

### Pre-requisites:
- [Python 3.7 and above](https://www.python.org/downloads/)
- [Poetry](https://python-poetry.org/)
- [Docker](https://docs.docker.com/engine/install/)
- [docker-compose](https://docs.docker.com/compose/install/)

### Installing dependencies
```bash
poetry shell # sets up and activates a venv
poetry install # installs missing dependencies from the lockfile
```

### Run migrations
```bash
python manage.py makemigrations
python manage.py migrate
```

### Start the server

In debug
```bash
python manage.py runserver
```

In production
```bash
docker-compose up -d --build
```

## More info
This template comes with an already existing model. Feel free to modify or remove it.

API docs can be found at:
- http://localhost:8000/docs (OpenAPI 3)
- http://localhost:8000/redoc (ReDoc)