Introducing the new starter kit for Wagtail CMS
See just how quick you can get a Wagtail site up and running
At the most recent What’s New in Wagtail event, I unveiled a project we have been working on for a few months: a fully-fledged starter template for Wagtail.
Currently, if you want to play around with Wagtail, most people head to the Wagtail Bakery Demo (bakerydemo). The Bakery Demo is a great example of a Wagtail site, which you can easily get up and running locally (manually, or using Vagrant or Docker), and then start getting to grips with Wagtail and its Admin, to see if it’s right for you. See how to edit and publish pages, upload images and even build custom workflows.
However, once you’re happy Wagtail is right for you, and want to build something for yourself, the Bakery Demo is not the best starting point. We have seen people re-skin and build upon the Bakery Demo, but that’s not really what it’s for. If you follow Wagtail’s “Your first Wagtail site” guide, you get a skeleton project with a long road between you and the Wagtail equivalent of “Hello World” - and that’s if you’re already fairly confident with Django.
In the last few months, Torchbox has created the Wagtail News Template, a template specifically designed to get you off the ground, so to speak. Out of the box, you get a high-performance, production-grade Wagtail site, complete with fully-featured frontend, and even dark mode.
You can take your new Wagtail project as-is and deploy it without any further code changes, then start writing and publishing your content. The template is intended for a simple news site, with news articles, listings, simple pages and site search.
Alternatively, you can use it as a stable foundation, installing additional packages and tweaking the layouts to match your needs. No need to build the frontend from the ground up - Sass, Webpack and Tailwind are all configured and ready to turn your designs into a reality.
Creating your project
Using the template is very simple. Whilst Wagtail comes with a skeleton project template, you can specify your own. Assuming you have Wagtail installed, a project based on the news template is just one command away:
wagtail start --template=https://github.com/torchbox/wagtail-news-template/archive/refs/heads/main.zip mynewssite .
The above command will create a new Wagtail project called “mynewssite” in the current directory (the dot on the end). After just a few seconds, the folder will be filled with your own Wagtail site.
Once you install the dependencies defined in the requirements.txt file, and load the initial data (using the make load-data command), you can run manage.py runserver and see your newly-created news site in your browser, running on your computer.
Whether you want to start playing around with the Wagtail Admin (available at /admin), or start digging into the code to see how it works, the site is yours.
Deployment
With Wagtail running on your computer, you can play around with it to your heart’s content - safe in the knowledge no one else on the internet can interfere with it or see what you’re working on. But, after a while, letting people on the internet see it is exactly what you’ll want to do.
For this, our news template can help you once again, with built-in support for easily deploying to Fly.io. Fly.io is a platform loved by many, and makes it easy to get your site from your computer to the internet. Nothing about our template, or Wagtail templates in general, is coupled to Fly.io, or any other hosting provider for that matter. We’ve added the support to get people into production sooner. It would be easy to create templates with similar levels of support for Digital Ocean, Heroku, Kubernetes, or any other hosting provider you prefer.
Much like creating the Wagtail site itself, deploying it to Fly.io is equally simple. There’s a configuration file already in place to get you going, which you can tweak in future depending on how popular your site becomes. By running “fly launch” and following the prompts as shown in the project’s README, your site will be running on Fly.io in just a few minutes, ready for anyone in the world to see.
Once deployed, you can log in (once you change the password, of course) and start creating and publishing your news articles. Or, go back to your code editor, and change the styles to suit your brand.
The Future
We hope this is the first of many templates created for Wagtail. Anyone can and should create templates for whatever they like. Perhaps a template for a personal portfolio, intranet, or even a bakery? A template doesn’t even need to be public, should you want to create a starter template for your company’s projects. We hope you do share your templates though, and if there are any you're particularly proud of, please let us know on social media or our Slack community.
Together, we hope we can raise the bar for Wagtail’s “Hello World” developer experience by making it quicker and easier to get started and build something great.