Django / Production

Step 24 of 24

Webhooks et cache

Utilisez le cache Django pour des lectures de traductions locales rapides et exposez un webhook signé pour les mises à jour d'Altified.

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.