Fix PostGIS backend configuration

- Properly override database engine to use PostGIS after dj_database_url parsing
- Ensures spatial database operations work correctly with PostgreSQL PostGIS
This commit is contained in:
pacnpal
2025-08-19 18:55:03 -04:00
parent 31a1465890
commit 7937f70f6a

View File

@@ -93,16 +93,19 @@ WSGI_APPLICATION = "thrillwiki.wsgi.application"
# Database # Database
DATABASES = { # Parse database URL but use PostGIS engine
"default": dj_database_url.config( db_config = dj_database_url.config(
default="postgresql://thrillwiki:thrillwiki_secure_password@localhost:5432/thrillwiki", default="postgresql://thrillwiki:thrillwiki_secure_password@localhost:5432/thrillwiki",
conn_max_age=600, conn_max_age=600,
conn_health_checks=True, conn_health_checks=True,
) )
}
# Ensure PostGIS backend is used # Override engine to use PostGIS
DATABASES["default"]["ENGINE"] = "django.contrib.gis.db.backends.postgis" db_config["ENGINE"] = "django.contrib.gis.db.backends.postgis"
DATABASES = {
"default": db_config
}
# Cache settings # Cache settings
CACHES = { CACHES = {