Recent Posts (Page 2)

How to Lock Your Project’s Node.js Version

I’m chicken you have the right Node.js!

It’s a good idea to ensure your project uses the same Node.js version in all environments. This way you can be sure that your code will work as expected, from development to production.

Read more...

How to Squash and Rebase a Git Branch

We gotta Git out of this place.

It can be tiresome to rebase feature branches with many commits. You may have several commits that conflict with your main branch. Before rebasing such branches, you may want to squash your commits together, and then rebase that single commit, so you can handle all conflicts at once. Here’s how to do that.

Read more...

How to Run a Command on Many Files in Your Git Repository

Git getting you feeling crabby?

Occasionally it’s useful to run commands on files in your repository, or all files matching a pattern. This is possible by combining git ls-files and xargs.

Read more...

django-htmx Now on Read the Docs

Artist’s impression of my writing desk.

I’ve just released django-htmx 1.9.0. As part of this release, it now has a documentation site built with Sphinx, hosted on Read the Docs at django-htmx.readthedocs.io.

Read more...

Announcing WhiteNoise 6

I guess, like the white keys let you make noise, white - noise, whitenoise. Get it?

WhiteNoise is a simple solution to serving static assets. It lets you skip configuring a separate web server for your static assets, and serve them straight from Django. It’s a brilliant tool. I’ve used it for years on various projects, and I’ve recommended it many times, and mentioned it in several blog posts.

Read more...

Appearance on Podcast.__init__

Doot-dee-doot.

I joined host Tobias Macey on Podcast.__init__, in Episode 349, published this monday. The episode is titled “Improve Your Productivity By Investing In Developer Experience Design For Your Projects”. We covered various topics related to “developer experience” and general ways to improve it on any Python project.

Read more...

How to Set Up Source Maps with Django

“Now where on this map is node_modules?”

Source maps are files that map your minified CSS or JavaScript back to the original code. They allow you to use your browser’s development tools to debug minified code as if it were the original. Also some error capture tools, such as Sentry, can use source maps to report errors for the original code.

Read more...

A Problem with Duplicated Mutable Constants

Hey! You’re just like me!

Here’s a small problem I’ve seen where several modules share versions of the same “constant” variable. It came up in the context of a Django project with multiple settings files, but it could happen in different contexts.

Read more...

Optimize your PNG’s with oxipng and pre-commit

Artist’s impression of a PNG optimizer.

PNG’s can be losslessly optimized to reduce their file size, by picking a better compression algorithm for the given image. The savings can be significant, like 50% (especially for macOS screenshots). This is an easy way to make web sites load faster.

Read more...

On Receiving the Malcolm Tredinnick Award

Flowers.

In December I was awarded the Malcolm Tredinnick Award. This is an annual award, selected by nominations from anyone in the Django community. I’m incredibly honoured to have been selected, joining a fine list of past recipients. I’ve been inspired by every one of them.

Read more...