cd GeoDjangoPOCCreate a .env file in the project root (same directory as docker-compose.yml) and define your dev db/creds:
DB_NAME=
DB_USER=
DB_PASSWORD=Make sure Docker Desktop is running, then build and start the containers in detached mode:
docker compose up -d --buildThis launches both the PostGIS database and the Django app.
To run Django management commands inside the running container, for example use:
docker compose exec web python manage.py makemigrations
docker compose exec web python manage.py migrate
docker compose exec web python manage.py createsuperuser
docker compose exec web python manage.py seed_samplelocationsYou can replace makemigrations, migrate, etc. with any Django command as needed.
-
Admin Portal:
http://localhost:8000/admin/ -
Home Page:
http://localhost:8000/ -
API Docs:
http://localhost:8000/api/docs/ -
Sample Locations API Endpoint Example:
http://localhost:8000/api/samplelocations/
To shut down all containers:
docker compose downTo also remove volumes (for a clean slate - this will delete your db storage):
docker compose down -v- You do not need to install Python, GDAL, or PostGIS locally—everything runs in Docker.
- All Django/Python commands should be run using
docker compose exec web python manage.py .... - Make sure your
.envDB credentials match yourdocker-compose.ymland Django settings. - Docker Desktop must be running before using
docker compose. - The database service must be healthy before Django can connect.