Skip to content

zhanymkanov/django_template

Repository files navigation

Django Project Template

This is a Django project template for Django 4.2 that I use to start new projects.

  • Docker, docker-compose
  • Pydantic for configs loading
  • Configured with uvicorn for async compatibility
  • just for shortcuts
  • black + ruff for linting
  • Simple logging

How to start working

Prerequisites:

  • Install just
  • Install docker
  1. Build the project
just build
  1. Run the project
just up
  1. Migrate the database
just migrate
  1. Create superuser
just django createsuperuser
  1. Collect static
just django collectstatic
  1. Done! Go to http://0.0.0.0:8100/admin/ and login with the superuser you created.

Shortcuts

  • just - list all available shortcuts

Docker shortcuts:

  • just build - build the project
  • just up - run the project

Linting shortcuts:

  • just lint - lint the project with black and ruff
  • just black - just black the project
  • just ruff - just ruff the project

Django shortcuts:

  • just migrate - migrate the database
  • just mm *app_name* -n *migration_name* - create a migration for the app_name called migration_name
  • just django - run django management command
  • just startapp *app_name* - create a new app called app_name

About

Template I use for starting django with docker, postgres, uvicorn, logging, ruff, black

Topics

Resources

Stars

Watchers

Forks