First off… A brief introduction to Wagtail and Why(tail)
Wagtail is an open source CMS written in Python and built on the Django framework. Built by developers for developers, it offers a fast attractive interface for editors where content can be created and structured intuitively.
Chances are you’ve heard of Drupal and Wordpress. In the past I’ve also used CodeIgnighter and Laravel, the common thread here being PHP. So I have to say I was somewhat intimidated at first when checking out Wagtail mainly because of Python. I didn’t do programming at university, so Python has always been a bit scary to me but after getting into it, it’s bloody amazing.
Really, choosing Wagtail or Drupal or Wordpress should and probably will be a function of what you are aiming to build. It should be a considered choice. These frameworks can be leveraged to build all sorts and there are many of pros and cons that will arise when comparing frameworks, if you would like to know more just google Drupal vs Wordpress and pretty soon you’ll forget what you were supposed to be building in the first place. My new rule of thumb is ‘How can this be made simple?’
So, recently I decided to lift a site from Drupal 8 and move it to Wagtail to test the water. End to end it took me a weekend, here is what I liked.
1. It’s geared towards publishing
Having being inside the Drupal UI for so long, it was strange to me to open an admin interface and pretty much just see publishing tools and some user settings. This is really nice, it means that the owner can just focus on content, no overwhelming configuration, no content types, no displays, no no no.
The content all hinges on the main menu structure, so you can move pages around to be parents or children pretty easily. I like this simple elegant approach. It really does focus on content and I very much support freezing the configuration of a site as much as possible to maintain the designers original intent. In a previous life, when I used to make print work for Studiocanal, there were rules around logos you just could not break and I believe this strict visual ruleset should exist on the web.
2. It’s built on Django
I’m still learning how this all sits but from the development work I have done, it’s the ability to utilise Django in your Wagtail site. To some this may sound obvious but to me it wasn’t. I heard loads of chatter about Symfony being in Drupal 8 and how it was amazing, but unless you’re really in the depths of development you won’t even need to notice Symfony. Whereas in Wagtail, if you are looking to do something in one of your apps, you can use anything from Django (and you probably will be doing).
If you are about to take this journey yourself I would recommend doing the Django Tutorial too so you can see what Django is like on it’s own.
3. It’s a better development experience.
One thing I loved about Laravel was the way it handled migrations. In Drupal this is managed with the features module and more recently config import and exports with .yaml files. Laravel was ace because you wrote out your ‘content types’ and then ran
php artisan migrate (IIRC) and the schema code was generated. ACE. Don’t get me wrong, Drupal can handle some complex configuration setups well, especially with config split, but anyone reading this who’s had to merge feature code conflicts will feel my pain.
In Wagtail, migrations are really similar to Laravel. You run commands to create migrations scripts, then run another command to run them. Sweet.
That’s not the name of a fancy new js front end framework, I mean there is no development through the UI going on. Everything you (as a developer) make will be in code. Lovely Python code, with no more semi-colons.
There are huge positives to this. Mainly, developers should feel like developers . From my experience, nearly every developer prefers to be in the code. But also, I’ve seen too many sites turn a bit rough around the edges due to people creating and editing content types in Drupal without knowing the associated risks. Sure you can say “well, it’s in the wild now… come what may.” But you really don’t have to risk your work becoming vulgar. Wagtail doesn’t just remove that risk, it also says “You worry about the publishing and I’ll worry about the rest.”
4. Hosting can be simple
Ok, this made my head spin a bit more. What is UWISGI, what on earth is Gunicorn. Well I’m still not 100% on this, but I started looking at where to host and how to host and it turns out I didn’t need to know about it really.
Naturally I just span up docker on AWS as I usually would with something new, but I ran into things a bit out of my technical capabilities. Luckily, I started looking at how people host Django and found Heroku. Like the return of an old friend (from when I used to make facebook apps) hosting on Heroku is pretty straightforward. This post from Kyle Rutten is absolutely amazing and will take you through setting up your Wagtail site on Heroku.
5. Documentation is ace
I have a hard time reading documentation, I don’t know why but it just seems to take me longer than others.The Django documentation really deserves awards for how great it is. The Wagtail docs are good too, so there are enough resources available to help with pretty much anything. There are still the usual channels… google groups, stack overflow and github issues but it’s refreshing to have the official docs as your first stop on the solution bus.
6. It’s Python!
Prior to getting into Wagtail I started learning some python, mainly via Treehouse and some small personal projects like Squares. There are tonnes of resources to learn Python given it’s age and popularity, it’s really about finding the method that works for you. Treehouse gave me enough to get going. It’s worth checking out Flask too, a micro web framework for Python.
Locally, I’ve used Vagrant and Docker in the past. You can use these with Wagtail and Django, but you can also use Virtualenv and the newer Pipenv. My favourite at the moment is Pipenv, it’s really quick and easy to just get going. But for those really large projects Vagrant and a full VM is probably still going to be the best solution.
As a developer it can be intimidating stepping into another world, especially one like Python. But I recommend just checking it out. Wagtail and Django have a lot going for them, I was really surprised at how easy it was to get something done and the performance it’s amazing.
Do it… do it now https://wagtail.io/developers/