Minimal Django app for testing the Django Debug Toolbar with GeoDjango/PostGIS.
System libraries:
# Ubuntu/Debian
sudo apt install libgdal-dev libgeos-dev libproj-dev
# macOS
brew install gdal geos projdocker run -d --name postgis \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=geodjango \
-p 5433:5432 \
postgis/postgis:17-3.5uv syncInstalls Django, psycopg2-binary, and django-debug-toolbar from ../debug_toolbar/ (editable).
uv run python manage.py migrate
uv run python manage.py runserverVisit http://127.0.0.1:8000/. On first load, three locations are seeded and a spatial distance query runs:
SELECT ST_Distance("proj_location"."point", ST_GeomFromEWKB('\x...'::bytea)) AS "distance"
FROM "proj_location"
ORDER BY 1The Django Debug Toolbar appears on the right side of the page — check the SQL panel to inspect the GeoDjango-generated queries.
| Setting | Value |
|---|---|
| Host | localhost |
| Port | 5433 |
| Database | geodjango |
| User | postgres |
| Password | postgres |
docker stop postgis && docker rm postgis