Gitpod Setup
Run the demo in a cloud development environment with zero local setup required.Prerequisites
- GitHub account
- Modern web browser
Installation Steps
Gitpod Features
- Pre-configured Environment: Python, Node.js, and all dependencies installed
- VS Code in Browser: Full IDE experience with Python extensions
- Port Forwarding: Automatic HTTPS URLs for your development server
- Persistent Workspaces: Your changes are saved between sessions
Docker Setup
Use Docker Compose to run the demo with PostgreSQL and Redis in containers.Prerequisites
Install Docker and Docker Compose:- Docker Desktop (includes Docker Compose)
- Or install Docker Engine and Docker Compose separately
Installation Steps
Build Containers
- db: PostgreSQL 18.1 database
- redis: Redis 8.4 cache
- app: Django application with Python 3.12
-d flag runs containers in the background.Access the Demo
The site is now running:
- Frontend: http://localhost:8000/
- Admin: http://localhost:8000/admin/
- Credentials:
admin / changeme
Docker Configuration
Thedocker-compose.yml configures:
Useful Docker Commands
Vagrant Setup
Use Vagrant to run the demo in a Ubuntu virtual machine.Prerequisites
Install the following on your host machine:Installation Steps
Start Vagrant VM
- Download the Ubuntu Jammy64 box (if not already cached)
- Create and configure the virtual machine
- Install Python and all dependencies
- Set up the database and load demo data
The first run takes several minutes as Vagrant downloads the box image and provisions the VM.
Start Development Server
Inside the SSH session, run:
The
0.0.0.0 address is required so the server is accessible from your host machine.Access the Demo
From your host machine’s browser:
- Frontend: http://localhost:8000/
- Admin: http://localhost:8000/admin/
- Credentials:
admin / changeme
Vagrant Configuration
TheVagrantfile configures:
Vagrant Commands
Stopping the Server
- Press
Ctrl+Cin the SSH session to stop the Django server - Type
exitto leave the SSH session - Run
vagrant haltto stop the VM
Venv Setup
Traditional Django development setup using Python’s built-in virtual environment.Prerequisites
- Python 3.10 or higher
- pip (Python package installer)
- venv (included with Python 3.3+)
This method is recommended for developers familiar with Django and Python development.
Installation Steps
Create Virtual Environment
Your terminal prompt should now show
(.venv) indicating the virtual environment is active.Install Dependencies
- Django 6.0+
- Wagtail 7.2+
- PostgreSQL adapter (psycopg)
- Development tools (debug toolbar, extensions)
- All other required packages
Create Configuration Files
Windows users: use
copy instead of cplocal.py- Django settings overrides.env- Environment variables
Set Up Database
Windows users: use
python manage.py instead of ./manage.pyStart Development Server
- Frontend: http://127.0.0.1:8000/
- Admin: http://127.0.0.1:8000/admin/
- Credentials:
admin / changeme
Project Dependencies
Key packages fromrequirements/base.txt:
Configuration Files
The demo uses several configuration files:| File | Purpose | Required |
|---|---|---|
bakerydemo/settings/local.py | Local Django settings overrides | No, but recommended |
.env | Environment variables (secrets, URLs) | No, but recommended |
bakerydemo/settings/base.py | Base Django configuration | Yes |
bakerydemo/settings/dev.py | Development settings | Yes |
bakerydemo/settings/production.py | Production settings | Yes |
Warnings will be displayed if
local.py and .env are not present, but they’re not strictly required for basic functionality.Using PostgreSQL Locally
To use PostgreSQL instead of SQLite:Install PostgreSQL
Install PostgreSQL for your platform:
- Ubuntu/Debian:
sudo apt install postgresql postgresql-contrib - macOS:
brew install postgresql - Windows: Download from postgresql.org
Django Management Commands
Troubleshooting
Database Connection Issues
PostgreSQL connection refused
PostgreSQL connection refused
Docker: Wait 10-15 seconds after
docker compose up for PostgreSQL to initialize.Local: Ensure PostgreSQL is running:Database 'app_db' does not exist
Database 'app_db' does not exist
You need to run migrations first:
Import Errors
ModuleNotFoundError
ModuleNotFoundError
Ensure your virtual environment is activated and dependencies are installed:
ImportError: No module named 'wagtail'
ImportError: No module named 'wagtail'
The virtual environment may not be activated, or Wagtail isn’t installed:
Port Already in Use
Address already in use: 0.0.0.0:8000
Address already in use: 0.0.0.0:8000
Another service is using port 8000. Either stop that service or use a different port:For Docker:
Docker Issues
docker compose command not found
docker compose command not found
You may have an older version of Docker. Try:Or update Docker Desktop to the latest version.
Permission denied on Linux
Permission denied on Linux
Add your user to the docker group:
Static Files Issues
Static files not loading
Static files not loading
Collect static files:For Docker:
Testing Different Wagtail Versions
The demo’smain branch works with both the latest stable Wagtail release and the development version. To test specific versions:
v6.4- Compatible with Wagtail 6.4v6.3- Compatible with Wagtail 6.3v6.2- Compatible with Wagtail 6.2v6.1- Compatible with Wagtail 6.1
Next Steps
Explore the Code
Read through the source code to understand how Wagtail applications are structured. Pay special attention to models, blocks, and hooks.
Try the Features
Log into
/admin/ and experiment with creating pages, uploading images, and using StreamField.Read Wagtail Docs
Visit docs.wagtail.org to learn more about Wagtail’s features and best practices.
Start Your Project
Ready to build your own site? Use
wagtail start to create a new project from scratch.
