Configuration¶
Configuration is environment-driven (.env, .env.example).
Core Django Settings¶
SECRET_KEYDEBUGALLOWED_HOSTSCSRF_TRUSTED_ORIGINS
Database Settings¶
DATABASE_URLTEST_DATABASE_URLTEST_USE_DATABASE_URLTEST_REUSE_EXISTING_DBPARCEL_STORAGE_SRIDPARCEL_STORAGE_PROJ4
Behavior:
DATABASE_URLis required for runtime commands and must point to PostGIS- Tests require
TEST_DATABASE_URL, orTEST_USE_DATABASE_URL=TruewithDATABASE_URL TEST_DATABASE_URLuses default Django test DB create/drop flow- Set
TEST_REUSE_EXISTING_DB=Trueonly for legacy in-place reuse mode - PostGIS test create/drop flow may require superuser privileges to run
CREATE EXTENSION postgisin fresh test databases - SQLite/SpatiaLite fallback is no longer supported
Parcel CRS Settings¶
PARCEL_STORAGE_SRID: authoritative parcel storage SRID, must be projected and meter-basedPARCEL_STORAGE_PROJ4: matching PROJ string used by browser meter readouts and helper toolingPARCEL_DISPLAY_SRID: fixed in code to4326, not runtime-configurableUTM_EPSG: legacy compatibility alias derived fromPARCEL_STORAGE_PROJ4unless explicitly overridden
Behavior:
- Choose
PARCEL_STORAGE_SRIDbefore the first parcel migration/init on a database - The deployed parcel schema freezes one storage SRID and startup checks verify env/schema alignment
- Do not change
PARCEL_STORAGE_SRIDon an initialized parcel database - If you need a different storage CRS, reset parcel data, rebuild the schema, and reload seed/demo data
- Browser map payloads and transient interactive geometry remain
EPSG:4326only at the server transformation boundary. - GeoJSON and KML are export-only file formats and default to
EPSG:4326. - Production geometry-file imports require a declared projected CRS with known
linear units and a valid GDAL/PROJ transformation to
PARCEL_STORAGE_SRID; missing/geographic/non-transformable CRS input is rejected. - Parcel area/perimeter and other metric operations use the stored projected geometry
Map Settings¶
DEFAULT_MAP_CENTER_LAT,DEFAULT_MAP_CENTER_LNGDEFAULT_MAP_ZOOM,MIN_MAP_ZOOMUTM_EPSGDEFAULT_TILE_PROVIDEROSM_TILE_URL,SATELLITE_TILE_URL
Per-user Boundary Snapping¶
Boundary snapping uses database-backed per-user settings rather than environment variables. Defaults are point, edge, and follow-edge enabled, 12-pixel tolerances, a 1.00-metre maximum distance, and minimum zoom 18. Users edit the record only from the main parcel map's Map Settings; create and update editors inherit it.
The runtime publishes the frozen storage SRID and Proj4 definition for an early browser metre-distance filter. PostGIS remains authoritative for committed coordinates and distances. Paired snapping_runtime_css.html and snapping_runtime_js.html includes load separately from basemap runtime assets and only on supported editor pages.
Snapping introduces no geometry-file import path. GeoJSON/KML remain export formats. Production parcel imports continue to require GeoPackage or zipped Shapefile input with a declared, reprojectable non-geographic CRS and known linear units.
Optional External Basemaps¶
STADIA_MAPS_API_KEY,STADIA_VECTOR_STYLE_URL,STADIA_SATELLITE_STYLE_URL,STADIA_SATELLITE_FALLBACK_URLMAPTILER_API_KEY,MAPTILER_STREETS_STYLE_URL,MAPTILER_DATAVIZ_STYLE_URL,MAPTILER_TOPO_STYLE_URL
Set MAPTILER_API_KEY to offer MapTiler Streets, Dataviz, and Topo in the main
parcel-map Basemap selector. A blank value omits all three choices. The default
styles are Streets v4, Dataviz Light, and Topo v2; the per-style variables are
optional overrides. Every other map display inherits the browser choice made on
/parcels/map/, including styled, raster, PMTiles, and None backgrounds.
MapTiler browser map keys are visible in map requests. Use a separate
application-specific key restricted to the exact deployed HTTP origin or origins.
Do not put MapTiler account-management credentials or service tokens in this
configuration. Secondary maps, including standalone /map/, have no background
selector but render the inherited approved provider through the shared runtime.
The admin Basemap Catalog discovers configured MapTiler providers automatically. Administrators can include them in the allowed subset and select one as default. Staff and non-staff users receive the same approved subset. The admin catalog continues to show the full technical inventory for troubleshooting. If a non-empty approved subset has no available entries, runtime maps receive no providers and use the no-background state; they never escape to an unapproved technical provider. If no subset entries are configured, all currently available providers remain implicitly approved.
Raster Overlay Settings¶
RASTER_TILES_ROOT: filesystem root where pre-generated raster XYZ tiles are storedRASTER_TILES_URL: URL prefix used by the raster tile-serving endpointRASTER_QUERY_ROOT: filesystem root where queryable raster sources are stored for point sampling
Grid Summary Settings¶
GRID_SUMMARY_COARSE_ZOOM_MAXGRID_SUMMARY_FINE_ZOOM_MAXGRID_SUMMARY_COARSE_CELL_METERSGRID_SUMMARY_FINE_CELL_METERSGRID_SUMMARY_MAX_INDIVIDUAL_PARCELSCLUSTERING_CACHE_TIMEOUT
Notes:
- These values can be overridden at runtime in Django admin via
Parcels -> Parcel Map Settings. - If no
Parcel Map Settingsrow exists, environment values are used as fallback.
File Upload Limits¶
FILE_UPLOAD_MAX_MEMORY_SIZEDATA_UPLOAD_MAX_MEMORY_SIZE
Security/Production Settings¶
Applied when DEBUG=False, including:
- SSL redirect and forwarded host settings
- secure session/csrf cookies
- HSTS
- hardened static storage (
CompressedManifestStaticFilesStorage)