mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-29 01:47:00 -05:00
Compare commits
2 Commits
7937f70f6a
...
a6158c0564
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6158c0564 | ||
|
|
411669ce8d |
@@ -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')
|
||||
|
||||
@@ -93,18 +93,19 @@ WSGI_APPLICATION = "thrillwiki.wsgi.application"
|
||||
|
||||
# Database
|
||||
|
||||
# Parse database URL but use PostGIS engine
|
||||
# Parse database URL but force PostGIS engine
|
||||
db_config = dj_database_url.config(
|
||||
default="postgresql://thrillwiki:thrillwiki_secure_password@localhost:5432/thrillwiki",
|
||||
conn_max_age=600,
|
||||
conn_health_checks=True,
|
||||
)
|
||||
|
||||
# Override engine to use PostGIS
|
||||
db_config["ENGINE"] = "django.contrib.gis.db.backends.postgis"
|
||||
|
||||
# Force PostGIS engine - override any parsed engine
|
||||
DATABASES = {
|
||||
"default": db_config
|
||||
"default": {
|
||||
**db_config,
|
||||
"ENGINE": "django.contrib.gis.db.backends.postgis",
|
||||
}
|
||||
}
|
||||
|
||||
# Cache settings
|
||||
|
||||
Reference in New Issue
Block a user