A cookiecutter template for building Wagtail and Django packages according to the the Wagtail package maintenance guidelines.
# Shortest one-liner, you will be prompted for important package information.
uvx cookiecutter gh:wagtail/cookiecutter-wagtail-packageThis creates a simple Python/Django app with a nested "test" app.
This creates Github Workflows for:
- Running tests and linters on pushes and pull requests
- Running tests nightly against latest Wagtail version
- Pushing packages to PyPI when GitHub releases are created. This requires two additional setup steps before it can be used:
- Create a pending publisher in PyPI: https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/
- Create an environment called "publish" in GitHub: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#creating-an-environment
Firstly install cookiecutter:
python -m pip install "cookiecutter>=2"
Then run it like so:
cookiecutter git@github.com:wagtail/cookiecutter-wagtail-package.git
It'll ask for some details about you (name and email) and your project.
When it asks for your project name, exclude the "Wagtail" prefix. For example, if your project is called "Wagtail Llamas", set your project name to "Llamas" and accept all the default project name variants it generates (unless you used a special character in the project name).