A1: Django skeleton with web and worker processes (ADR-54, ADR-55, WEB-01, WEB-07, ARC-70..74)
Django 5.2 project (config/, apps/accounts with a custom User and case-insensitive usernames, apps/lottery with the run_worker command, apps/web with a placeholder home and /health/live, apps/ops), SQLite in WAL with IMMEDIATE transactions, secrets and hosts from the environment. The compose stack is now web + worker + caddy and serves https://localhost; the old FastAPI service is out of the stack until roadmap D1. The three old infrastructure tests follow the new Dockerfile and compose. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
79f7ebe53e
commit
fc23a75c9b
43 files changed
+709
-61
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class WebConfig(AppConfig):
|
||||
name = "apps.web"
|
||||
label = "web"
|
||||
@@ -0,0 +1,14 @@
|
||||
<!doctype html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>PLM Lottery</title>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>PLM Lottery</h1>
|
||||
<p>Il sito è in costruzione.</p>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,9 @@
|
||||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
|
||||
app_name = "web"
|
||||
urlpatterns = [
|
||||
path("", views.home, name="home"),
|
||||
path("health/live", views.health_live, name="health-live"),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
from django.db import connection
|
||||
from django.http import HttpResponse, JsonResponse
|
||||
from django.shortcuts import render
|
||||
|
||||
|
||||
def home(request):
|
||||
"""Placeholder landing page: the real home (WEB-10) arrives with A6."""
|
||||
return render(request, "web/home.html")
|
||||
|
||||
|
||||
def health_live(request):
|
||||
"""Liveness for the container healthcheck: the process answers and the database opens (ARC-73)."""
|
||||
try:
|
||||
with connection.cursor() as cursor:
|
||||
cursor.execute("SELECT 1")
|
||||
except Exception:
|
||||
return HttpResponse("database unavailable", status=503, content_type="text/plain")
|
||||
return JsonResponse({"status": "ok"})
|
||||
Reference in new issue
Block a user