mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 06:11:07 -05:00
remove backend
This commit is contained in:
39
config/settings/database.py
Normal file
39
config/settings/database.py
Normal file
@@ -0,0 +1,39 @@
|
||||
"""
|
||||
Database configuration for thrillwiki project.
|
||||
"""
|
||||
|
||||
import environ
|
||||
from pathlib import Path
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
||||
|
||||
env = environ.Env(
|
||||
DATABASE_URL=(
|
||||
str,
|
||||
"postgis://thrillwiki_user:thrillwiki@localhost:5432/thrillwiki_test_db",
|
||||
),
|
||||
GDAL_LIBRARY_PATH=(str, "/nix/store/c5y314zvvrbr9lx4wh06ibl1b5c07x92-gdal-3.11.0/lib/libgdal.so"),
|
||||
GEOS_LIBRARY_PATH=(str, "/nix/store/r5sgxqxrwfvms97v4v239qbivwsmdfjf-geos-3.13.1/lib/libgeos_c.so"),
|
||||
CACHE_URL=(str, "locmemcache://"),
|
||||
CACHE_MIDDLEWARE_SECONDS=(int, 300),
|
||||
CACHE_MIDDLEWARE_KEY_PREFIX=(str, "thrillwiki"),
|
||||
)
|
||||
|
||||
# Database configuration
|
||||
db_config = env.db("DATABASE_URL")
|
||||
|
||||
# Switch back to PostgreSQL - GeoDjango issues resolved separately
|
||||
DATABASES = {
|
||||
"default": db_config,
|
||||
}
|
||||
|
||||
# GeoDjango Settings - Environment specific with fallbacks
|
||||
GDAL_LIBRARY_PATH = env("GDAL_LIBRARY_PATH")
|
||||
GEOS_LIBRARY_PATH = env("GEOS_LIBRARY_PATH")
|
||||
|
||||
# Cache settings
|
||||
CACHES = {"default": env.cache("CACHE_URL")}
|
||||
|
||||
CACHE_MIDDLEWARE_SECONDS = env.int("CACHE_MIDDLEWARE_SECONDS")
|
||||
CACHE_MIDDLEWARE_KEY_PREFIX = env("CACHE_MIDDLEWARE_KEY_PREFIX")
|
||||
Reference in New Issue
Block a user