Welcome to Enzed Online!

What does a Kyrgyz glacier have to do with an IT consultancy? Not a lot, but it does highlight one of the fundamental keys of engagement in web design: to pique curiosity on landing on your site to encourage reading on, you've generally got a couple of seconds to do that before the visitor's attention span runs out and moves on to the next attention grabber. Mostly though, it's there because Kyrgyzstan has some of the best and undeveloped hiking I've ever come across, go if you have half a chance!

I've built this site with Django & Wagtail CMS, I'll be sharing plenty of experiences, gotchas and tips on the tech blog for anyone that might find this useful.

About me: I have 23 years of experience in IT across a wide range of industries and roles, mostly as a contractor and consultant, ultimately as head of IT for a leading international tourism company in New Zealand. In between, I love to travel, hike and photograph (the three happily go together) and to experiment with cuisine from around the world.

These days, you'll find me in the countryside close to Barcelona. If you're an employer looking to fill a gap that you think I might be a good fit for, either for a project or more permanently, feel free to head over to my About page or contact me directly here. I have rights to work in Spain, UK, NZ and Australia, and would be happy to consider other locations as well.

Tech Blog

Here I'll be sharing insights from my professional experiences, and studies in data science and web development, and explanations of how this site was built for those who want to learn.

Personal Blog

If the tech stuff is too heavy for your taste, head over here for my great passions - travel, hiking, photography and world cuisine. I like to combine as many of these as I can whenever I get the opportunity ...

Latest Blog Posts

Use JavaScript to Add a Dynamic Table of Contents to Your Pages

Use JavaScript to Add a Dynamic Table of Contents to Your Pages

Creating a table of contents or menu based on content is time-consuming for editors and prone to errors. You may need such a feature on your data fed pages and not even have the ability to create and link to content on the page.

Here, I create an automated, on-the-fly table of contents without the need for hard-coded anchor links, regardless of the source of your content. It's easily adaptable to turn into a nav bar or similar menu. Similarly, this technique could be used to produce a summary with links on an API data feed page for rapid data analysis and drill-down capability.

At the end, I wrap it in a Wagtail stream block ready to drop into your templates.

Translating Static Template Text with Wagtail Localize

Translating Static Template Text with Wagtail Localize

You have all your page content and snippet components translating successfully, but what to do with all those bits of static text in the non-Wagtail pages?

Static text lurks in the error pages, search results, e-mail templates and any Django pages that may be getting served on your site.

Here's an easy way to keep it all under the Wagtail Localize umbrella without the pain of making PO files and peppering your templates with blocktrans tags.

Dealing with UNIQUE Fields on a Multi-lingual Site

Dealing with UNIQUE Fields on a Multi-lingual Site

In Django and Wagtail, for many translation models, a copy of the page tree is made for each language rather than inserting the translated text directly into the template or model. This poses a problem for models that have fields with UNIQUE constraints as attempting to save a copy of the default language instance will trigger an integrity error (ie duplicate key). Fortunately, if you're using the TranslatableMixin, there's a way around this.

Configuring a Dynamic Sitemap on Wagtail

Configuring a Dynamic Sitemap on Wagtail

A sitemap lists a website’s most important pages, making sure search engines can find and crawl them. It's important to keep your sitemap up to date for optimal SEO. With a quick bit of coding, you can set your sitemap to be created dynamically on demand, ensuring it always reflects the latest content. There's another tweak needed for routable pages and multi-lingual sites using wagtail-localize.

The old dock at Kjerringøy, Bodø, Nordland, Norway

The old dock at Kjerringøy, Bodø, Nordland, Norway

Instagram post from the historic handelssted of Kjerringøy on the Strandå peninsula north of Norway, an open air museum on the Arctic coast.

Wagtail - Configure the robots.txt and Block Search Indexing (the correct way)

Wagtail - Configure the robots.txt and Block Search Indexing (the correct way)

Rather than just being a static file, you can use Django/Wagtail templating to create a dynamically generated robots.txt. This is not the place to block search engine crawlers though, I'll show a method to apply that from your base template.

Carrot Cake with Cream Cheese Icing

Carrot Cake with Cream Cheese Icing

I get asked for this recipe very time I make it, so here it is in all it's glory, the best carrot cake there is, with my own tweaks added in. You can thank me later.

Open Wagtail Rich Text Block Links in a New Tab

Open Wagtail Rich Text Block Links in a New Tab

You'd think this would be something you could do out of the box, but the makers of Wagtail have stated that this is against their philosophy and won't ever be implementing it. Here's a simple fix to circumvent that decision.

Cleaning Images Using Frequency Separation

Cleaning Images Using Frequency Separation

Frequency separation is a powerful technique for cleaning photos from dust spots, lens flare and much more, and also a very good way of targeted sharpening. This excellent video from Jimmy McIntyre gives a great explanation of how to do it.

A 3 year journey

A 3 year journey

In 2016, I took the opportunity to head out on a journey that took me from one end of Asia to the other end of Europe on a fairly convoluted path.