Configuration Reference
Django Hurricane provides a flexible configuration system supporting Django Settings, Command-Line Arguments, and Environment Variables.
Configuration Conventions & Precedence
Full Symmetry Between Prefixed and Unprefixed Names
Hurricane provides 100% naming symmetry across all configuration formats:
- Django
settings.py: Every setting can be declared using the concise setting name (e.g.PORT = 8000,RATE_LIMIT = "10/s",FAST_404 = "auto") or the explicit namespaced equivalent (e.g.HURRICANE_PORT = 8000,HURRICANE_RATE_LIMIT = "10/s"). Both forms are evaluated identically. - Environment Variables: Can be specified with
HURRICANE_(recommended in container environments to avoid name collisions) or without (e.g.HURRICANE_PORT=8000orPORT=8000). - Rate Limiting: Rate limiting can be configured directly with individual scalar settings (
RATE_LIMIT,RATE_LIMIT_BURST,RATE_LIMIT_PROXY_HEADER,RATE_LIMIT_ENABLED) without requiring a nested dictionary. (The dictionary syntaxHURRICANE_RATE_LIMIT = {"ENABLED": True, "RATE": 10.0, ...}continues to be supported). - CLI Arguments: Standard command-line flags passed to
python manage.py serve(e.g.--port=8000).
Precedence Order
When the same parameter is specified in multiple places, Hurricane resolves the final value in this order:
- CLI Arguments (highest priority)
- Django
settings.py(recommended for application configuration) - Environment Variables (ideal for container runtime overrides)
Server Core Settings
PORT
The TCP port on which the HTTP application server listens for incoming Django traffic.
PROBE_PORT
Dedicated port for Kubernetes health probes (/alive, /ready, /startup) and Prometheus metrics (/metrics). Keeping probe traffic isolated prevents health checks from being starved by heavy application traffic. When omitted, defaults to port + 1.
MODE
Application execution mode. Supported values: auto, wsgi, asgi. In auto mode, Hurricane automatically detects whether ASGI_APPLICATION is set in your Django settings and runs ASGI; otherwise, it runs standard WSGI.
WORKERS
Number of native OS worker threads used to handle request concurrency. When omitted, defaults to the number of available CPU cores plus 4.
RUNTIME_THREADS
Number of Rust/Tokio async runtime worker threads in Granian. In ASGI mode, defaults to the number of available CPU cores (capped at 16) to allow multi-core event loop task scheduling. In WSGI mode, defaults to 1.
AUTORELOAD
Reloads code automatically when Python source file changes are detected. Intended for local development.
DEBUG
Enables verbose debug flag. When enabled, health probe errors return detailed error strings rather than generic status codes.
Static & Media File Serving
STATIC
Enables serving collected static files directly through the gateway using STATIC_URL and STATIC_ROOT from Django settings.
MEDIA
Enables serving media files directly through the gateway using MEDIA_URL and MEDIA_ROOT from Django settings.
STATIC_WATCH
List of directories to watch for changes during development; automatically triggers collectstatic when changes occur.
Fast-404 Security Settings
FAST_404
Fast-404 protection strategy. Supported values: auto, signature, prefix, or off. In auto mode, prefix matching is used when valid URL prefixes can be extracted, otherwise signature matching. Setting to off or passing --no-fast-404 disables the shield.
FAST_404_PATTERNS
List of custom regex patterns or file endings to drop at the gateway before reaching Django middleware or database connections.
FAST_404_EXTRA_PREFIXES
List of additional URL path prefixes to drop immediately at the gateway.
Rate Limiting Settings
RATE_LIMIT
Sustained request rate allowed per second per client IP address (e.g. 10/s, 20.0, or off / False to disable). Can also be configured via dictionary if preferred.
RATE_LIMIT_BURST
Burst token capacity allowed above the sustained rate limit for short traffic bursts.
RATE_LIMIT_PROXY_HEADER
Proxy header used to extract the client IP address behind load balancers or Kubernetes Ingress controllers.
RATE_LIMIT_ENABLED
Explicit boolean switch (True or False) to toggle the rate limiter without altering rate or burst thresholds.
Kubernetes Health Probes & Metrics
STARTUP_PROBE
URL route on the probe port for Kubernetes startup checks. Returns HTTP 200 once initialization and pre-flight commands have completed.
LIVENESS_PROBE
URL route on the probe port for Kubernetes liveness checks. Verifies that the server process and thread pool are actively responding.
READINESS_PROBE
URL route on the probe port for Kubernetes readiness checks. Verifies database connectivity and pending request backlog.
REQ_QUEUE_LEN
Maximum length of the pending request queue before /ready returns HTTP 400 to temporarily shed ingress traffic.
NO_PROBE
Disables the health probe server completely.
METRICS
URL route on the probe port for Prometheus metrics exposition.
NO_METRICS
Disables Prometheus metric collection and exposition.
LOG_PROBES
When False (default), HTTP access logging for probe requests (/alive, /ready, /startup, /metrics) is suppressed to prevent log noise. Set to True in settings.py to log all probe requests.
Process Lifecycle & Resource Limits
MAX_LIFETIME
Maximum number of requests after which a worker process is restarted. When None, processes run indefinitely.
MAX_MEMORY
Maximum memory (Resident Set Size) in megabytes before process reload. When None, no memory reload limit is enforced.
MAX_BODY_SIZE
Maximum size of the request body in bytes.
MAX_BUFFER_SIZE
Maximum size of the request buffer in bytes.
Startup Commands & Migrations
COMMAND
Management command to run asynchronously during pod startup before the server opens traffic.
CHECK_MIGRATIONS
Checks if pending database migrations were applied before starting the server.
CHECK_MIGRATIONS_APPLY
Checks if database migrations are pending and applies them automatically prior to opening traffic.
Debugger Settings
DEBUGGER
Opens a debugger port according to the Debug Adapter Protocol (e.g. for VS Code).
DEBUGGER_PORT
The port for the debug client to attach to.
PYCHARM_HOST
Host of the remote PyCharm debug server.
PYCHARM_PORT
Port of the remote PyCharm debug server.
Webhooks
WEBHOOK_URL
Target URL where Hurricane sends asynchronous lifecycle notifications (startup, liveness, graceful termination).
HURRICANE_VERSION
Custom version string included in webhook payloads for deployment tracking.
