One view — every article arrives as signed JSON.
Django renders the blog; DraftSEO feeds it. The recipe is one @csrf_exempt view wired in urls.py — request.body gives you the raw bytes for the HMAC check (the signature IS your authentication, so CSRF exemption is expected), and hmac.compare_digest verifies it before you save a model.
| Connection | One view — @csrf_exempt, wired in urls.py, recipe provided |
|---|---|
| Security | HMAC-signed + timestamped — hmac.compare_digest over ${timestamp}.${rawBody}, replay-window protected |
| Payload | Full article JSON — title, HTML, images, meta, slug, language |
| Images | DraftSEO CDN URLs — URLs ride in the payload; rehost to your own storage if you prefer |
| Framework fit | Plain view or DRF — save a Django model, render posts in your templates |
Who does what
Add the @csrf_exempt view, wire the URL, verify the HMAC over request.body, then create your Post model. Once the test is green, nothing more per article.
Your ORM and templates render the posts, not us.
Setup
Connect a site → Django. You get a signing secret and the view recipe.
~1 minute
Paste the @csrf_exempt view into views.py, wire it in urls.py, verify the signature and save the model.
~10 minutes
DraftSEO sends a signed test event; a green check confirms the connection.
~1 minute
Every generated article is delivered to your view on cadence.
Ongoing · zero clicks
FAQ
A JSON body { event, deliveryId, data } — data holds the title, HTML article, slug, language, meta fields and image URLs, so one json.loads gives you everything a Post model needs.
Each request is HMAC-signed over ${timestamp}.${rawBody} with a timestamp header; you recompute it with hmac.new and compare using hmac.compare_digest, rejecting anything past the 5-minute window. The @csrf_exempt decorator is required — the HMAC is the auth.
Either way. The recipe uses a plain @csrf_exempt view, but you can put the same signature check in a DRF APIView — verify the HMAC over request.body first, then handle the parsed payload.
No card required. Signed test delivery in under a minute.