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.
WORKERS
Maximum concurrency ceiling and worker thread pool size used to execute Django code. When omitted, defaults to the number of available CPU cores plus 4.
RUNTIME_THREADS
Number of Rust/Tokio async runtime worker threads in Hurricane's underlying Granian engine. Defaults to detected container CPUs (capped at 4) to prevent CFS quota throttling in small pods.
RUNTIME_MODE
Async runtime engine architecture in Granian: 'auto', 'st' (single-threaded runtime), or 'mt' (multi-threaded work-stealing runtime). In 'auto', defaults to 'st' if runtime_threads == 1 (optimal for Kubernetes pods with ≤ 1 vCPU to eliminate cross-thread synchronization overhead and avoid Linux CFS CPU quota throttling), and 'mt' when multiple runtime threads are allocated.
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 high-performance static file serving using STATIC_URL and STATIC_ROOT. When STATIC_ROOT is populated (e.g. after collectstatic), files are served natively in Rust via Granian at Nginx-grade speed (<20µs). In development or when STATIC_ROOT is empty, Hurricane automatically falls back to dynamic discovery across STATICFILES_DIRS and all installed apps without requiring collectstatic. For architecture details and workflows, see the Static & Media Files Guide.
COLLECTSTATIC
Automatically runs Django's collectstatic command during server pre-flight startup before the network socket binds. Populates STATIC_ROOT so Granian can immediately mount assets into its native Rust streaming engine.
MEDIA
Enables serving user-uploaded media files directly from MEDIA_ROOT under MEDIA_URL. Mounted natively in Granian when the directory exists on disk.
STATIC_WATCH
List of extra directories or file paths to watch for changes during development. When combined with --autoreload, modifying any watched asset triggers Granian to reload and synchronize static bundles.
STATIC_CACHE_EXPIRES
HTTP Cache-Control: max-age header duration in seconds applied to static assets served through Granian's native Rust mount. Defaults to 86400 (24 hours).
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, automatically falling back to signature matching when a root catch-all or CMS router is detected. For details on how signatures and on-demand caching operate, see the Signature Mode & Anti-Django Patterns Guide. 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. Custom patterns extend the comprehensive Built-in Signature Pattern Categories covering PHP/WordPress, Laravel, Java/Spring Actuators, ASP.NET, Node.js, and database dump probes.
FAST_404_EXTRA_PREFIXES
List of additional URL path prefixes to drop immediately at the gateway when running in prefix mode.
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.
