Sanity Studio Overview

Sanity Studio is the content management layer for Djanity. It provides the editing interface for products, stores, users, promotions, and inventory. Changes made in the Studio sync to Django automatically through webhooks, with field names transformed from camelCase (Sanity) to snake_case (Django).


Content Types

Products & Catalog

  • Products — Create and manage product listings (name, description, images, organization). Products act as the parent container for purchasable variants.
  • Product Variants — Individual purchasable items with SKU, pricing, and inventory tracking. Created within a product.
  • Product Attributes — Define characteristics like Size, Color, or Material that variants use.
  • Inventory Levels — Per-store stock quantities tied to product variants.
  • Planograms — Store layout and product placement configurations.

People & Places

  • Users — Customer and staff accounts with role assignments and store associations.
  • Stores — Physical store locations with addresses, operating hours, and configuration.

Promotions & Testing

  • Promo Codes — Discount codes with configurable rules, validity dates, and usage limits.
  • Campaigns — Promotional campaigns that group and schedule marketing efforts.
  • A/B Tests — Split testing configurations for comparing content variations.

How It Works

Sanity Studio (Content Editing)

    ├── Editor creates/updates a document
    ├── Document saved as draft
    ├── Editor publishes document


Sanity Webhook (Automatic)

    ├── POST to Django webhook endpoint
    ├── camelCase fields → snake_case transformation


Django Database (Synced Record)

    ├── Model instance created or updated
    ├── Signals fire for downstream processing
    └── Available via API

Document Workflow

  1. Draft — Changes are saved automatically as you edit
  2. Publish — Makes the document live and triggers the webhook sync
  3. Unpublish — Removes from public view
  4. Discard — Abandons draft changes without affecting the published version

Sync to Django

Some document types include a "Sync to Django" action in the publish menu. This manually triggers the webhook for cases where you need to force a re-sync without republishing.


Field Naming Convention

Sanity uses camelCase for field names. Django uses snake_case. The webhook processing layer handles this transformation automatically:

Sanity (camelCase)Django (snake_case)
productTypeproduct_type
firstNamefirst_name
isActiveis_active
promoCodepromo_code

Getting Started

If you're new to the Studio, start with these in order:

  1. Stores — Set up at least one store location
  2. Users — Create staff accounts with appropriate roles
  3. Products — Add products to the catalog
  4. Product Variants — Create purchasable variants within products
  5. Promo Codes — Set up any active promotions

Was this page helpful?