Django / Production

Step 23 of 23

Webhooks and cache

Use Django cache for fast local translation reads and expose a signed webhook for Altified updates.

For production, configure a shared Django cache such as Redis so all web workers read the same translations.

settings.py
CACHES = {
    "default": {
        "BACKEND": "django.core.cache.backends.redis.RedisCache",
        "LOCATION": "redis://127.0.0.1:6379",
    }
}

Expose the SDK webhook endpoint if you want Altified to push completed translations back into the application cache.

urls.py
from django.urls import include, path

urlpatterns = [
    ...,
    path("altified/", include("django_altified.urls")),
]
  • The webhook URL is /altified/webhook/.
  • Altified signs webhook bodies with HMAC-SHA256 using the existing ALTIFIED_API_KEY.
  • The SDK stores valid webhook translations in Django cache.
  • Local memory cache is fine for development but not enough for multi-worker production.

Signature header

Webhook requests must include X-Altified-Signature: sha256=<digest>. The raw API key is never sent as the webhook token.