Skip to content

nm-examples/wagtail-shop-kit

Repository files navigation

Wagtail Shop Kit

This is a starter kit for a Wagtail e-commerce project. It includes a Docker setup for local development, a basic project structure, and some useful tools and libraries.

You can use this project as a starting point for your own Wagtail shop projects and build upon it as needed.

Features

  • Docker Development Environment
  • Postgresql, Mysql or Sqlite3 Database
  • Frontend Node SASS and Javascript compilation
  • Pico CSS for almost classless styling
  • esbuild javascript bundler
  • Wagtail CMS v7.2
  • Django v5.2

Wagtail Shop Kit

Requirements

Required:

Optional:

  • Git (optional, for version control)
  • Make (optional, for running commands)
  • NVM (optional, for managing Node versions)
  • pre-commit (optional, for running code checks)
  • UV (optional, for managing Python dependencies)

Getting started

  1. Clone this repository to a location on your computer
  2. Change into the project directory
  3. Copy .env.example to .env and choose your database (default is SQLite). Set DATABASE=sqlite|postgres|mysql.
  4. Run make build to build the Docker containers
  5. Run make up to start the Docker containers
  6. Run make migrate to apply database migrations
  7. Run make superuser to create a superuser
  8. Run make run to start the Django development server

Note: .env is required. make build and make up validate environment variables via make check-env and will fail if required values are missing. See .env.example for all keys.

Quick start

There is a make command to run most of the steps above in one go:

make quickstart

You'll need to run make superuser separately.

If you haven't changed .env the app will default to:

Working with the fronend

The project uses Pico CSS for styling. It's a minmal setup that you can build on.

When you first run the project you may notice that no styling is applied. This is because the first time you run the project with make up the compiled frontend files might not be available. Just run the frontend build script and refresh the page. Read on

Working with the backend

The project uses Docker for local development. The Wagtail project is in the app directory. The project is set up to use a SQLite database by default. You can change this to use Mysql or Postgres. Read on

Management Commands

The project includes custom Django management commands to help with development and testing. These commands can be used to generate sample content, manage data, and perform administrative tasks.

For detailed documentation on all available commands, see Management Commands Documentation.

Quick Examples

# Create sample images and documents for testing
docker exec -it wagtail-shop-kit-app-1 python manage.py create_sample_media

# Reset all sample content
docker exec -it wagtail-shop-kit-app-1 python manage.py create_sample_media --reset

View the site

The site will be available at http://localhost:8000.

The Wagtail admin interface will be available at http://localhost:8000/admin.

Deployment

Currently there is no deployment setup included in this project. You could try this Wagtail deployment guide for some ideas.

Deployment Examples

  1. How to deploy a Wagtail site to PythonAnywhere, this does need you to have a paid account with PythonAnywhere.
  2. This example is a fork of this starter kit which has documentation on how to deploy to PythonAnywhere, using a free account.

Contributing

If you have any suggestions or improvements, please open an issue or a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

All the bases covered for a Wagtail e-commerce build

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors