mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 10:31:09 -05:00
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:
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user