mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-29 13:07:01 -05:00
Compare commits
2 Commits
7937f70f6a
...
a6158c0564
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6158c0564 | ||
|
|
411669ce8d |
@@ -7,8 +7,12 @@ import environ
|
|||||||
env = environ.Env()
|
env = environ.Env()
|
||||||
|
|
||||||
# Database configuration
|
# Database configuration
|
||||||
|
db_config = env.db()
|
||||||
|
# Force PostGIS backend for spatial data support
|
||||||
|
db_config['ENGINE'] = 'django.contrib.gis.db.backends.postgis'
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': env.db(),
|
'default': db_config,
|
||||||
}
|
}
|
||||||
|
|
||||||
# GeoDjango Settings - Environment specific
|
# GeoDjango Settings - Environment specific
|
||||||
@@ -20,6 +24,7 @@ CACHES = {
|
|||||||
'default': env.cache('CACHE_URL', default='locmemcache://')
|
'default': env.cache('CACHE_URL', default='locmemcache://')
|
||||||
}
|
}
|
||||||
|
|
||||||
CACHE_MIDDLEWARE_SECONDS = env.int('CACHE_MIDDLEWARE_SECONDS', default=300) # 5 minutes
|
CACHE_MIDDLEWARE_SECONDS = env.int(
|
||||||
CACHE_MIDDLEWARE_KEY_PREFIX = env('CACHE_MIDDLEWARE_KEY_PREFIX', default='thrillwiki')
|
'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
|
# Database
|
||||||
|
|
||||||
# Parse database URL but use PostGIS engine
|
# Parse database URL but force PostGIS engine
|
||||||
db_config = 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,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Override engine to use PostGIS
|
# Force PostGIS engine - override any parsed engine
|
||||||
db_config["ENGINE"] = "django.contrib.gis.db.backends.postgis"
|
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
"default": db_config
|
"default": {
|
||||||
|
**db_config,
|
||||||
|
"ENGINE": "django.contrib.gis.db.backends.postgis",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Cache settings
|
# Cache settings
|
||||||
|
|||||||
Reference in New Issue
Block a user