mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 09:31:09 -05:00
major changes, including tailwind v4
This commit is contained in:
@@ -31,7 +31,6 @@ INSTALLED_APPS = [
|
||||
"django.contrib.gis", # Add GeoDjango
|
||||
"pghistory", # Add django-pghistory
|
||||
"pgtrigger", # Required by django-pghistory
|
||||
"history.apps.HistoryConfig", # History timeline app
|
||||
"allauth",
|
||||
"allauth.account",
|
||||
"allauth.socialaccount",
|
||||
@@ -47,18 +46,10 @@ INSTALLED_APPS = [
|
||||
"accounts",
|
||||
"parks",
|
||||
"rides",
|
||||
"reviews",
|
||||
"email_service",
|
||||
"media.apps.MediaConfig",
|
||||
"moderation",
|
||||
"history_tracking",
|
||||
"designers",
|
||||
"operators",
|
||||
"property_owners",
|
||||
"manufacturers",
|
||||
"analytics",
|
||||
"location",
|
||||
"search.apps.SearchConfig", # Add search app
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
@@ -75,7 +66,7 @@ MIDDLEWARE = [
|
||||
"allauth.account.middleware.AccountMiddleware",
|
||||
"django.middleware.cache.FetchFromCacheMiddleware",
|
||||
"django_htmx.middleware.HtmxMiddleware",
|
||||
"analytics.middleware.PageViewMiddleware", # Add our page view tracking
|
||||
"core.middleware.PageViewMiddleware", # Add our page view tracking
|
||||
]
|
||||
|
||||
ROOT_URLCONF = "thrillwiki.urls"
|
||||
@@ -166,8 +157,7 @@ AUTHENTICATION_BACKENDS = [
|
||||
|
||||
# django-allauth settings
|
||||
SITE_ID = 1
|
||||
ACCOUNT_EMAIL_REQUIRED = True
|
||||
ACCOUNT_USERNAME_REQUIRED = True
|
||||
ACCOUNT_SIGNUP_FIELDS = ['email*', 'username*', 'password1*', 'password2*']
|
||||
ACCOUNT_LOGIN_METHODS = {'email', 'username'}
|
||||
ACCOUNT_EMAIL_VERIFICATION = "optional"
|
||||
LOGIN_REDIRECT_URL = "/"
|
||||
@@ -220,3 +210,15 @@ TAILWIND_CLI_DIST_CSS = os.path.join(BASE_DIR, "static/css/tailwind.css")
|
||||
TURNSTILE_SITE_KEY = "0x4AAAAAAAyqVp3RjccrC9Kz"
|
||||
TURNSTILE_SECRET_KEY = "0x4AAAAAAAyqVrQolYsrAFGJ39PXHJ_HQzY"
|
||||
TURNSTILE_VERIFY_URL = "https://challenges.cloudflare.com/turnstile/v0/siteverify"
|
||||
|
||||
# Test runner
|
||||
TEST_RUNNER = "django.test.runner.DiscoverRunner"
|
||||
|
||||
# Road Trip Service Settings
|
||||
ROADTRIP_CACHE_TIMEOUT = 3600 * 24 # 24 hours for geocoding
|
||||
ROADTRIP_ROUTE_CACHE_TIMEOUT = 3600 * 6 # 6 hours for routes
|
||||
ROADTRIP_MAX_REQUESTS_PER_SECOND = 1 # Respect OSM rate limits
|
||||
ROADTRIP_USER_AGENT = "ThrillWiki Road Trip Planner (https://thrillwiki.com)"
|
||||
ROADTRIP_REQUEST_TIMEOUT = 10 # seconds
|
||||
ROADTRIP_MAX_RETRIES = 3
|
||||
ROADTRIP_BACKOFF_FACTOR = 2
|
||||
|
||||
@@ -21,13 +21,9 @@ urlpatterns = [
|
||||
# Global rides URLs
|
||||
path("rides/", include("rides.urls", namespace="rides")),
|
||||
# Other URLs
|
||||
path("reviews/", include("reviews.urls")),
|
||||
path("operators/", include("operators.urls", namespace="operators")),
|
||||
path("property-owners/", include("property_owners.urls", namespace="property_owners")),
|
||||
path("manufacturers/", include("manufacturers.urls", namespace="manufacturers")),
|
||||
path("designers/", include("designers.urls", namespace="designers")),
|
||||
path("photos/", include("media.urls", namespace="photos")), # Add photos URLs
|
||||
path("search/", include("search.urls", namespace="search")),
|
||||
path("search/", include("core.urls.search", namespace="search")),
|
||||
path("api/map/", include("core.urls.map_urls", namespace="map_api")), # Map API URLs
|
||||
path(
|
||||
"terms/", TemplateView.as_view(template_name="pages/terms.html"), name="terms"
|
||||
),
|
||||
@@ -57,7 +53,6 @@ urlpatterns = [
|
||||
path("user/", accounts_views.user_redirect_view, name="user_redirect"),
|
||||
# Moderation URLs - placed after other URLs but before static/media serving
|
||||
path("moderation/", include("moderation.urls", namespace="moderation")),
|
||||
path("history/", include("history.urls", namespace="history")),
|
||||
path(
|
||||
"env-settings/",
|
||||
views***REMOVED***ironment_and_settings_view,
|
||||
|
||||
@@ -3,12 +3,10 @@ from django.views.generic import TemplateView
|
||||
from django.db.models import Count, Q, Value, CharField
|
||||
from django.db.models.functions import Concat
|
||||
from django.core.cache import cache
|
||||
from parks.models import Park
|
||||
from parks.models.parks import Park
|
||||
from parks.models.companies import Company
|
||||
from rides.models import Ride
|
||||
from operators.models import Operator
|
||||
from property_owners.models import PropertyOwner
|
||||
from manufacturers.models import Manufacturer
|
||||
from analytics.models import PageView
|
||||
from core.analytics import PageView
|
||||
from django.conf import settings
|
||||
import os
|
||||
import secrets
|
||||
@@ -102,7 +100,7 @@ class SearchView(TemplateView):
|
||||
Q(name__icontains=query) |
|
||||
Q(location__icontains=query) |
|
||||
Q(description__icontains=query)
|
||||
).select_related('operator').prefetch_related('photos')[:10]
|
||||
).select_related('operating_company').prefetch_related('photos')[:10]
|
||||
|
||||
# Search rides
|
||||
context['rides'] = Ride.objects.filter(
|
||||
@@ -111,26 +109,11 @@ class SearchView(TemplateView):
|
||||
Q(manufacturer__name__icontains=query)
|
||||
).select_related('park', 'coaster_stats').prefetch_related('photos')[:10]
|
||||
|
||||
# Search operators
|
||||
context['operators'] = Operator.objects.filter(
|
||||
# Search companies
|
||||
context['companies'] = Company.objects.filter(
|
||||
Q(name__icontains=query) |
|
||||
Q(headquarters__icontains=query) |
|
||||
Q(description__icontains=query)
|
||||
).prefetch_related('operated_parks')[:10]
|
||||
|
||||
# Search property owners
|
||||
context['property_owners'] = PropertyOwner.objects.filter(
|
||||
Q(name__icontains=query) |
|
||||
Q(headquarters__icontains=query) |
|
||||
Q(description__icontains=query)
|
||||
).prefetch_related('owned_parks')[:10]
|
||||
|
||||
# Search manufacturers
|
||||
context['manufacturers'] = Manufacturer.objects.filter(
|
||||
Q(name__icontains=query) |
|
||||
Q(headquarters__icontains=query) |
|
||||
Q(description__icontains=query)
|
||||
).prefetch_related('rides')[:10]
|
||||
).prefetch_related('operated_parks', 'owned_parks')[:10]
|
||||
|
||||
return context
|
||||
|
||||
|
||||
Reference in New Issue
Block a user