Prerequisites
Before you begin, ensure you have the following installed:- Python 3.10 or higher
- pip (Python package installer)
- Git
- venv (Python virtual environment)
Installation Methods
The Bakery Demo supports multiple installation methods. Choose the one that best fits your workflow:venv Setup
Traditional Python virtual environment setup
Docker Setup
Containerized development environment
Gitpod Setup
Cloud-based development environment
Vagrant Setup
VM-based development environment
Setup with venv
This is the recommended approach for developers familiar with Python and Django development.
Create Virtual Environment
Create and activate a Python virtual environment:On macOS/Linux:On Windows (cmd.exe):On Windows (PowerShell):
Install Dependencies
Install the required Python packages:This installs all necessary packages including:
- Django 6.0+
- Wagtail 7.2+
- Development tools (ruff, djhtml, curlylint)
- Extensions (django-debug-toolbar, django-extensions)
Configure Environment Files
Create local configuration files from the provided examples:
Understanding Configuration Files
Understanding Configuration Files
local.py - Local Django settings overridesThe You can add custom settings like database configurations, API keys, or debug settings here..env - Environment variablesThe
bakerydemo/settings/local.py file is loaded by dev.py and allows you to override any settings without committing them to version control. By default, it’s empty:.env file contains Content Security Policy (CSP) directives for testing Wagtail’s CSP compatibility. These are commented out by default:Wagtail is not fully compatible with strict CSP policies yet. Only uncomment these for testing purposes.
Initialize Database
Run migrations to create the database schema:This creates a SQLite database file named
bakerydemodb in your project root.Load Initial Data
Load the demo data including pages, images, and snippets:This command:
- Copies media files to the configured storage
- Removes auto-generated default Site and Page instances
- Loads fixture data from
bakerydemo/base/fixtures/bakerydemo.json - Updates the search index
- Rebuilds the references index
Start the Development Server
Launch the Django development server:The site will be available at:
- Frontend: http://localhost:8000/
- Admin: http://localhost:8000/admin/
admin / changemeSetup with Docker
This docker-compose.yml is configured for local testing only and is not intended for production use.
Install Docker
Ensure you have Docker and Docker Compose installed:
Setup Database
Wait 10 seconds for the database to initialize, then run:
If you encounter a database error, wait another 10 seconds and retry.
Start Services
Setup with Gitpod
The fastest way to try Wagtail Bakery Demo without local installation:Setup with Vagrant
For developers who prefer VM-based development:Install Dependencies
Install the required tools:
Start Server
Ctrl+c to stop the server, exit to leave SSH, then vagrant halt.
Database Configuration
By default, the project uses SQLite for development. You can configure a different database using environment variables.PostgreSQL Setup
Set theDATABASE_URL environment variable:
.env file:
When using PostgreSQL,
django.contrib.postgres is automatically added to INSTALLED_APPS.Development Settings
The project uses a layered settings structure:Key Development Settings
Frombakerydemo/settings/dev.py:
Custom Settings
Add your overrides tobakerydemo/settings/local.py:
Verifying Your Setup
After installation, verify everything works:Default Users
The demo data includes several user accounts for testing:| Username | Password | Role | Purpose |
|---|---|---|---|
admin | changeme | Superuser | Full admin access |
editor | changeme | Editor | Content editing |
moderator | changeme | Moderator | Content moderation |
german | changeme | Superuser | German language UI |
arabic | changeme | Superuser | Arabic language UI |
inactive | changeme | Superuser | Inactive account (testing) |
Next Steps
Now that your environment is set up:Management Commands
Learn about available management commands
Customization Guide
Customize the demo for your needs
Contributing
Contribute to the project
Project Structure
Understand the codebase organization
Troubleshooting
Port 8000 already in use
Port 8000 already in use
Specify a different port:
Database migration errors
Database migration errors
Reset the database:
Missing module errors
Missing module errors
Reinstall dependencies:
Permission denied on manage.py
Permission denied on manage.py
Make the file executable:

