Overview
All management commands are located inbakerydemo/base/management/commands/ and can be run using:
Available Commands
load_initial_data
Load demo fixtures and media files
create_random_data
Generate random content for testing
reset_demo
Reset demo to initial state
reset_admin_password
Update admin password from settings
load_initial_data
Loads the initial demo data including pages, images, snippets, and media files.Usage
What It Does
Copy Media Files
Recursively copies media files from This works with both local file storage and cloud providers like S3.
bakerydemo/base/fixtures/media to your configured storage backend.Clean Default Content
Removes the auto-generated default Site and Page instances that Wagtail creates during installation:
Example Output
Use Cases
- Initial project setup
- Restoring demo data after testing
- Setting up a new environment
- Resetting to a known good state
This command is automatically called by
reset_demo after resetting the database.create_random_data
Generates random pages, snippets, and images for performance testing and load testing.Usage
Arguments
Number of pages of each type to create (blog, bread, location, standard)
Number of snippets of each type to create (countries, ingredients, bread types, people, footer text)
Total number of images to create
Examples
What It Creates
Pages Created
Pages Created
Bread Pages (Location Pages (Blog Pages (Standard Pages (
page_count items)page_count items)page_count items)page_count + 1 items)Creates one top-level page and page_count child pages nested under it.Snippets Created
Snippets Created
For each snippet type, creates
snippet_count items:- Countries: Random country names
- Bread Ingredients: Random ingredient names
- Bread Types: Random bread type names
- People: Random person with first name, last name, job title, and image
- Footer Text: Random footer content
Images Created
Images Created
Creates
image_count images by randomly selecting from fixtures:Example Output
Use Cases
- Performance Testing: Generate large datasets to test page load times
- Load Testing: Create thousands of pages to test server capacity
- UI Testing: Test pagination, filtering, and search with lots of content
- Database Optimization: Test query performance with realistic data volumes
reset_demo
Resets the entire demo to its initial state by wiping the database and reloading fixtures.Usage
Requirements
- PostgreSQL database (will not work with SQLite)
django-extensionsinstalled (included in development requirements)
What It Does
Example Output
Use Cases
- Reset demo after testing destructive operations
- Clean slate for demonstrations
- Fix database corruption issues
- Prepare staging environment
Alternative for SQLite
If you’re using SQLite, manually reset by:reset_admin_password
Updates the admin user’s password to match theADMIN_PASSWORD setting.
Usage
What It Does
Configuration
The password is read from settings (default: “changeme”):Setting a Custom Password
Use Cases
- Synchronize password across environments
- Reset password after demo sessions
- Automate deployment scripts
- Called automatically by
reset_demo
This command only updates the password if a user named “admin” exists. It will raise an error if the admin user is not found.
Built-in Django Commands
The demo also uses standard Django and Wagtail management commands:Database Management
Search Index
User Management
Data Export
Development
Common Workflows
Fresh Start
Performance Testing
Demo Preparation
Tips and Best Practices
Run commands in virtual environment
Run commands in virtual environment
Always ensure your virtual environment is activated:
Use verbosity flags for debugging
Use verbosity flags for debugging
Add
-v 2 or -v 3 for more detailed output:Script multiple commands
Script multiple commands
Create a setup script for common workflows:
Backup before destructive operations
Backup before destructive operations
Always backup data before running reset commands:
Next Steps
Customization Guide
Learn how to customize the demo
Project Structure
Understand the codebase layout

