Django project template based on cookiecutter.
Project preconfigured with best practices and tools to work from the box with minimal configuration and setup. Fast start achieved by using docker and docker compose.
- Settings via environment variables with django-environ.
- Celery configuration.
- Django REST Framework configuration + Swagger with drf-spectacular.
- Typical user CRUD APIs.
- Docker support using docker-compose configuration for local development (incl. Postgres, Redis & MailPit for testing emails).
- Requirements management with poetry.
- pytest configuration.
- Code formatting with Ruff.
- Checking code with Ruff - which includes flake8, isort, bandit, pylint etc.
- Pre-commit hook for running test & linters on each commit.
- Integration with Sentry.
Installed cookiecutter and docker
Step into directory you want to create project and generate project with cookiecutter:
cd /path/to/directory
cookiecutter https://github.com/django-stars/backend-skeleton
Answer the questions in wizard.
Step into directory of your project.
Copy .env
file from example file:
cp ./api/.env.example ./api/.env
Run application:
make compose-up
We are using docker for running the app, so you don't have to keep your python env locally.
But we also use pre-commit hooks, and the safety
hook requires poetry
to be in your PATH
.
Tip
Ensure the poetry installed with the same python version as in pyproject.toml