KuaqSon / mokuton

Another starter template with Django.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mokuton

Another starter template with Django

Key Features

  • RESTful API: This template is for design purposes and rapid deployment based on the power from Django.
  • Django Ninja: Very high performance web framework for building APIs. Thanks to vitalik / django-ninja
  • Very basic account authentication kit: Forget about the initial steps from the login / registration and start racing business.
  • Preconfigured Huey: A little task queue for python

Installation

pip install -r requirements.txt

Usage

Migrate database

python manage.py makemigrations

python manage.py migrate

Run server

python manage.py runserver

Create superuser for the first run

python manage.py createsuperuser

Interactive API docs

Now go to http://127.0.0.1:8000/api/docs

You will see the automatic interactive API documentation (provided by Swagger UI):

Huey task queue

In one terminal, run:

python manage.py run_huey

Deployment

Make sure there's .env.prod file existed with the right environment variables. Should clone template from .env.prod-sample

Build docker image

docker-compose -f docker-compose.prod.yml build

Running docker image in detached mode

docker-compose -f docker-compose.prod.yml up -d

Access server container bash

docker exec -it <django-container-id> /bin/bash

Access live django shell

docker exec -it <django-container-id> python manage.py shell

About

Another starter template with Django.


Languages

Language:Python 96.7%Language:Shell 2.9%Language:Dockerfile 0.4%