Skip to content

Files

Latest commit

 

History

History

{{ cookiecutter.project_slug }}

{{ cookiecutter.project_name }}

Code style: Ruff

List of services

  • Dev server: [https://{{ cookiecutter.domain_name }}/](https://{{ cookiecutter.domain_name }}/)

Documentation

API documentation

  • ReDoc web UI: [https://{{ cookiecutter.domain_name }}//docs/v1/redoc/](https://{{ cookiecutter.domain_name }}//docs/v1/redoc/)
  • Swagger web UI: [https://{{ cookiecutter.domain_name }}//docs/v1/swagger/](https://{{ cookiecutter.domain_name }}//docs/v1/swagger/)
  • Schema YAML: [https://{{ cookiecutter.domain_name }}//docs/v1/schema/](https://{{ cookiecutter.domain_name }}//docs/v1/schema/)

First run

Application is running in docker containers.

Prerequisites

Installed docker

Copy initial settings for Django project

cp ./api/.env.example ./api/.env

Important

It is highly advised to use custom admin location instead of default admin/. To do that you need set {{ cookiecutter.__env_prefix }}DJANGO_ADMIN_URL environment variable in ./api/.env file with custom value.

Run application with required services

make compose-up

Your application will be available at http://localhost:8000

How it works

  • make compose-up will run docker-compose with all services
    • if images is missed it will build them
    • if there is no poetry.lock file present, Poetry simply resolves all dependencies listed in your api/pyproject.toml file and downloads the latest version of their files. But in any case it's good practice to lock your dependencies and share the lock file with your team, to do that run make api-lock command, and commit poetry.lock file to the repository.
  • it will use api/.env file to set environment variables for api and celery services. Check env_file section in docker-compose.yml

Any changes in docker files or python dependency will require to rebuild images, to do that run make compose-build command.

Create superuser

Run bash on api docker container

make api-bash

Run createsuperuser manage.py command

python manage.py createsuperuser

Follow instructions

Docker

Application is running in docker containers. It allows to run application in the same environment on any machine with minimal setup. If you need python environment, to run some commands, just use make api-bash, and you will be in the container with all dependencies installed.

Note

To ensure your code follow the standards etc. we strongly recommend to use pre-commit locally, that means you need to have it installed manually, see pre-commit hook docs for more details.