Configure PostgreSQL with PostGIS support

- Updated database settings to use dj_database_url for environment-based configuration
- Added dj-database-url dependency
- Configured PostGIS backend for spatial data support
- Set default DATABASE_URL for production PostgreSQL connection
This commit is contained in:
pacnpal
2025-08-19 18:51:33 -04:00
parent 274ba650b3
commit f4f8ec8f9b
44 changed files with 22869 additions and 8 deletions

View File

@@ -2,6 +2,7 @@
Django settings for thrillwiki project.
"""
import dj_database_url
from pathlib import Path
import os
@@ -91,17 +92,18 @@ TEMPLATES = [
WSGI_APPLICATION = "thrillwiki.wsgi.application"
# Database
DATABASES = {
"default": {
"ENGINE": "django.contrib.gis.db.backends.postgis", # Update to use PostGIS
"NAME": "thrillwiki",
"USER": "wiki",
"PASSWORD": "thrillwiki",
"HOST": "192.168.86.3",
"PORT": "5432",
}
"default": 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"
# Cache settings
CACHES = {
"default": {