From c4ca4348edc5c4fd6cc36e9833fbb9c697f3bf9d Mon Sep 17 00:00:00 2001 From: Caine Date: Thu, 2 Apr 2026 23:08:43 +0100 Subject: Phase 4: HTMX frontend with dark palette - 4 pages: Pantry, Recipes, Shopping List, Cook Log - HTMX-powered: add/delete pantry items, toggle shopping, generate smart list - Custom 13-colour palette from Lospec (dark bg, yellow accent) - Mobile-responsive - Whitenoise for static files in production - All routes under /app/ - API (/api/) stays internal, frontend (/app/) for browser use --- food_project/settings.py | 7 +++++++ food_project/urls.py | 1 + 2 files changed, 8 insertions(+) (limited to 'food_project') diff --git a/food_project/settings.py b/food_project/settings.py index 5e3dcee..80171df 100644 --- a/food_project/settings.py +++ b/food_project/settings.py @@ -55,6 +55,7 @@ REST_FRAMEWORK = { MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', @@ -129,6 +130,12 @@ USE_TZ = True # https://docs.djangoproject.com/en/5.2/howto/static-files/ STATIC_URL = 'static/' +STATIC_ROOT = BASE_DIR / 'staticfiles' +STORAGES = { + "staticfiles": { + "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage", + }, +} # Default primary key field type # https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field diff --git a/food_project/urls.py b/food_project/urls.py index 8acbe51..a788823 100644 --- a/food_project/urls.py +++ b/food_project/urls.py @@ -21,4 +21,5 @@ urlpatterns = [ path('admin/', admin.site.urls), path('api/', include('kitchen.urls')), path('api-auth/', include('rest_framework.urls')), # browsable API login + path('app/', include('kitchen.urls_htmx')), # HTMX frontend ] -- cgit v1.2.3