Configure PostGIS backend in correct database settings file

- Modified config/settings/database.py to force PostGIS engine
- This ensures spatial database operations work with PostgreSQL PostGIS
- The config-based settings structure was being used instead of thrillwiki/settings.py
This commit is contained in:
pacnpal
2025-08-19 19:05:28 -04:00
parent 74b45aa143
commit ca7555c052

View File

@@ -7,8 +7,12 @@ import environ
env = environ.Env()
# Database configuration
db_config = env.db()
# Force PostGIS backend for spatial data support
db_config['ENGINE'] = 'django.contrib.gis.db.backends.postgis'
DATABASES = {
'default': env.db(),
'default': db_config,
}
# GeoDjango Settings - Environment specific
@@ -20,6 +24,7 @@ CACHES = {
'default': env.cache('CACHE_URL', default='locmemcache://')
}
CACHE_MIDDLEWARE_SECONDS = env.int('CACHE_MIDDLEWARE_SECONDS', default=300) # 5 minutes
CACHE_MIDDLEWARE_KEY_PREFIX = env('CACHE_MIDDLEWARE_KEY_PREFIX', default='thrillwiki')
CACHE_MIDDLEWARE_SECONDS = env.int(
'CACHE_MIDDLEWARE_SECONDS', default=300) # 5 minutes
CACHE_MIDDLEWARE_KEY_PREFIX = env(
'CACHE_MIDDLEWARE_KEY_PREFIX', default='thrillwiki')