Seed Data Guide¶
This guide covers managing seed data for development and testing.
Catalog Manager¶
The Django admin includes a Catalog Manager GUI for importing/exporting product data.
Access at: http://localhost:8000/admin/products/catalog/
Export Catalog¶
- Go to Catalog Manager
- Click "Export Catalog"
- Download the generated YAML file
Import Catalog¶
- Go to Catalog Manager
- Upload a YAML file
- Review the import preview
- Confirm the import
YAML Format¶
# catalog.yaml
categories:
- name: T-Shirts
slug: t-shirts
children:
- name: Short Sleeve
slug: short-sleeve
colors:
- name: Zwart
hex_code: "#000000"
- name: Wit
hex_code: "#FFFFFF"
sizes:
- name: S
type: clothing
chest_width: 91
body_length: 69
- name: M
type: clothing
chest_width: 97
body_length: 72
products:
- name: Classic T-Shirt
slug: classic-t-shirt
sku: TSHIRT-001
category: t-shirts/short-sleeve
base_price: 24.95
variants:
- color: Zwart
size: S
stock: 100
- color: Zwart
size: M
stock: 150
Django Fixtures¶
Load Fixtures¶
Create Fixtures¶
Test Data Script¶
Creates: - Sample categories - Sample products with variants - Sample designs - Test user accounts
Database Reset¶
Development Only
This destroys all data!