mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 06:11:07 -05:00
feat: Implement enhanced park list template with improved layout and accessibility features
- Created a new enhanced park list template with a responsive design. - Added skip navigation links for better accessibility. - Introduced an enhanced header section with park statistics overview. - Developed a sidebar for advanced filters and a search section. - Implemented loading overlay and error handling for HTMX requests. - Enhanced park results display with animations and improved empty states. - Added pagination controls with improved UX for navigating park listings.
This commit is contained in:
@@ -2,38 +2,68 @@
|
||||
Database configuration for thrillwiki project.
|
||||
"""
|
||||
|
||||
import environ
|
||||
from pathlib import Path
|
||||
from decouple import config
|
||||
|
||||
# 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_URL=config("DATABASE_URL")
|
||||
GDAL_LIBRARY_PATH=config("GDAL_LIBRARY_PATH")
|
||||
GEOS_LIBRARY_PATH=config("GEOS_LIBRARY_PATH")
|
||||
CACHE_URL=config("CACHE_URL")
|
||||
CACHE_MIDDLEWARE_SECONDS=config("CACHE_MIDDLEWARE_SECONDS")
|
||||
CACHE_MIDDLEWARE_KEY_PREFIX=config("CACHE_MIDDLEWARE_KEY_PREFIX")
|
||||
|
||||
|
||||
# Database configuration
|
||||
db_config = env.db("DATABASE_URL")
|
||||
db_url = config("DATABASE_URL")
|
||||
|
||||
# Parse the database URL and create proper configuration dictionary
|
||||
def parse_db_url(url):
|
||||
# Simple parsing for PostgreSQL URLs
|
||||
if url.startswith('postgres://') or url.startswith('postgis://'):
|
||||
# Format: postgres://username:password@host:port/database
|
||||
# Remove the protocol part
|
||||
if url.startswith('postgis://'):
|
||||
url = url.replace('postgis://', '')
|
||||
elif url.startswith('postgres://'):
|
||||
url = url.replace('postgres://', '')
|
||||
# Split the URL into parts
|
||||
auth_part, rest = url.split('@', 1)
|
||||
host_port, database = rest.split('/', 1)
|
||||
|
||||
username, password = auth_part.split(':', 1) if ':' in auth_part else (auth_part, '')
|
||||
host, port = host_port.split(':', 1) if ':' in host_port else (host_port, '5432')
|
||||
|
||||
return {
|
||||
'ENGINE': 'django.contrib.gis.db.backends.postgis',
|
||||
'NAME': database,
|
||||
'USER': username,
|
||||
'PASSWORD': password,
|
||||
'HOST': host,
|
||||
'PORT': port,
|
||||
}
|
||||
# Add support for other database types if needed
|
||||
else:
|
||||
raise ValueError(f"Unsupported database URL format: {url}")
|
||||
|
||||
# Switch back to PostgreSQL - GeoDjango issues resolved separately
|
||||
DATABASES = {
|
||||
"default": db_config,
|
||||
"default": parse_db_url(db_url),
|
||||
}
|
||||
|
||||
# GeoDjango Settings - Environment specific with fallbacks
|
||||
GDAL_LIBRARY_PATH = env("GDAL_LIBRARY_PATH")
|
||||
GEOS_LIBRARY_PATH = env("GEOS_LIBRARY_PATH")
|
||||
GDAL_LIBRARY_PATH = config("GDAL_LIBRARY_PATH")
|
||||
GEOS_LIBRARY_PATH = config("GEOS_LIBRARY_PATH")
|
||||
|
||||
# Cache settings
|
||||
CACHES = {"default": env.cache("CACHE_URL")}
|
||||
# Cache settings - Use simple local memory cache for development
|
||||
CACHES = {
|
||||
'default': {
|
||||
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
|
||||
'LOCATION': 'unique-snowflake',
|
||||
}
|
||||
}
|
||||
|
||||
CACHE_MIDDLEWARE_SECONDS = env.int("CACHE_MIDDLEWARE_SECONDS")
|
||||
CACHE_MIDDLEWARE_KEY_PREFIX = env("CACHE_MIDDLEWARE_KEY_PREFIX")
|
||||
CACHE_MIDDLEWARE_SECONDS = config("CACHE_MIDDLEWARE_SECONDS")
|
||||
CACHE_MIDDLEWARE_KEY_PREFIX = config("CACHE_MIDDLEWARE_KEY_PREFIX")
|
||||
|
||||
Reference in New Issue
Block a user