Skip to content

Request Lifecycle

Purpose

Describe the end-to-end HTTP request path and where to troubleshoot failures.

When To Use This Page

  • debugging response errors or permission failures
  • analyzing performance bottlenecks
  • understanding where cross-module logic executes

Request Path

sequenceDiagram
    autonumber
    participant U as User
    participant I as Ingress
    participant MW as Middleware Chain
    participant V as View Layer
    participant M as Model Layer
    participant DB as PostgreSQL

    U->>I: request
    I->>MW: dispatch
    MW->>V: authorized request
    V->>M: domain operation
    M->>DB: query/commit
    DB-->>V: data
    V-->>U: response

Pipeline Responsibilities

  • ingress routing to app service
  • middleware enforcement (security/auth/csrf/mfa/login)
  • domain view orchestration
  • model/query execution and persistence
  • optional async task enqueue

Troubleshooting Matrix

Symptom First Check Next Check
redirect loops/login failures auth/middleware config host/csrf settings
permission denials view-level access logic role/context propagation
stale/missing data model queries and transactions async completion status
slow responses query volume and N+1 patterns template/view-level heavy operations

Diagnostics Commands

docker compose logs -f app
docker compose run --rm app python manage.py check
Async side path

Some requests enqueue background work. If UI shows delayed state, inspect celery/redis health and task completion.