Skip to main content
The backend uses Docker for local development. All services — the Django application, PostgreSQL database, and Redis cache — run as containers defined in docker-compose/local/compose.yaml.

Prerequisites

Docker

Install Docker Desktop or the Docker Engine with the Compose plugin.

pre-commit

Install pre-commit and run pre-commit install in the repository root to activate hooks.

Getting started

1

Clone the repository

git clone https://github.com/OWASP/Nest.git
cd Nest
2

Copy the environment file

Copy the example file and fill in the required values. See Environment variables for the full reference.
cp backend/.env.example backend/.env
3

Start all services

Run the full stack from the repository root:
docker compose -f docker-compose/local/compose.yaml up
Or use the convenience Makefile target:
make run
Docker Compose starts the following containers:
ContainerDescription
nest-backendDjango application server
nest-dbPostgreSQL database
nest-cacheRedis instance
nest-workerDjango RQ background worker
4

Run database migrations

After the containers are up, apply all pending migrations:
make migrate
5

Create a superuser (optional)

Create a Django admin account to access the /admin/ interface:
make create-superuser

Makefile targets

The repository provides a set of make targets that execute commands inside the running nest-backend container.
TargetCommandDescription
make migratepython manage.py migrateApply database migrations
make migrationspython manage.py makemigrationsGenerate new migration files
make create-superuserpython manage.py createsuperuserCreate a Django admin superuser
make test-backendpytest (inside Docker)Run the full backend test suite
make django-shellpython manage.py shellOpen the interactive Django shell
make index-datapython manage.py algolia_reindexRe-index all data in Algolia
make enrich-dataMultiple management commandsEnrich chapters, projects, and events from external sources
make dump-datapython manage.py dump_dataDump the current database state
make load-datapg_restore …Restore the database from a dump
Run make help from the repository root to see all available targets with descriptions.

Running tests

The test suite requires no additional setup beyond having Docker running.
make test-backend
Tests run inside an isolated container using pytest-xdist for parallel execution. Coverage must be at or above 95% for the suite to pass.
The backend .env.example file is used as the environment when running tests, so you do not need a separate test .env.

Build docs developers (and LLMs) love