summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorTyler Hoang <tyler@tylerhoang.xyz>2026-05-06 23:43:35 -0700
committerTyler Hoang <tyler@tylerhoang.xyz>2026-05-06 23:43:35 -0700
commitea6462e928f588c3fbff32e0850298d3ff3dbfb4 (patch)
tree251446b62003236d1c99b53e6381fac68bc3f4b8 /main.py
parentead38fdb13abb406065cef0743d7e411cb27eaf3 (diff)
Add /about page with rating system explanation
Introduces a public-facing /about page that explains the 1-3 star rating rubric with real examples pulled from the diary. Each star tier displays 3 randomly-selected, unique films (deduplicated by title to avoid rewatch duplicates). Changes: - New routers/about.py: GET /about queries films by stars, dedupes, randomizes - New templates/about.html: Page with eyebrow, h1, three tier sections with example film cards, closing philosophy, and View Profile button - main.py: Import about router, register it, add /about to public_paths in AuthMiddleware - templates/base.html: Add About nav link after Stats - templates/profile.html: Add About link to /tyler nav - templates/login.html: Add About and View Profile buttons in footer, plus "Made with Lumière" repo link Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Diffstat (limited to 'main.py')
-rw-r--r--main.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.py b/main.py
index a861cda..6b1a06b 100644
--- a/main.py
+++ b/main.py
@@ -9,14 +9,14 @@ from starlette.middleware.sessions import SessionMiddleware
from starlette.middleware.base import BaseHTTPMiddleware
from database import init_db
-from routers import auth, films, imports as imports_router, profile, stats, tmdb
+from routers import about, auth, films, imports as imports_router, profile, stats, tmdb
load_dotenv()
class AuthMiddleware(BaseHTTPMiddleware):
async def dispatch(self, request: Request, call_next):
- public_paths = {"/login", "/logout", "/tyler", "/films/partial"}
+ public_paths = {"/about", "/login", "/logout", "/tyler", "/films/partial"}
path = request.url.path
if path.startswith("/static") or path in public_paths:
@@ -42,6 +42,7 @@ app.add_middleware(AuthMiddleware)
app.add_middleware(SessionMiddleware, secret_key=session_secret)
app.mount("/static", StaticFiles(directory="static"), name="static")
+app.include_router(about.router)
app.include_router(auth.router)
app.include_router(profile.router)
app.include_router(tmdb.router)