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 f4f8ec8f9b
commit d9fc13f350

View File

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