TrueGIS

GeoDjango + PostGIS Starter: Build a Simple Web GIS Backend

Reading time: ~7 min

If you need a server-side data source for your web maps, GeoDjango + PostGIS is a dependable stack. You can serve GeoJSON to your front-end (Leaflet/OpenLayers) and still use TrueGIS for fast, client-side prints.

What you’ll build

Key steps (high level)

  1. Install PostGIS and create a spatial database.
  2. Enable GeoDjango in your Django project (GDAL/GEOS required).
  3. Create a model with PointField, LineStringField, or PolygonField.
  4. Expose a view that serializes features to GeoJSON.
  5. Consume from the browser using OpenLayers or Leaflet.

Workflow with TrueGIS

Keep your authoritative data in PostGIS/GeoDjango; when you just need a clean print, draw annotations in TrueGIS and use Scaled Print for a quick, accurate export.

Related reading: Prepare GeoJSON for TrueGIS and Leaflet vs OpenLayers.