mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 16:31:08 -05:00
- 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
31 lines
739 B
Python
31 lines
739 B
Python
"""
|
|
Database configuration for thrillwiki project.
|
|
"""
|
|
|
|
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': db_config,
|
|
}
|
|
|
|
# GeoDjango Settings - Environment specific
|
|
GDAL_LIBRARY_PATH = env('GDAL_LIBRARY_PATH', default=None)
|
|
GEOS_LIBRARY_PATH = env('GEOS_LIBRARY_PATH', default=None)
|
|
|
|
# Cache settings
|
|
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')
|