Sign in

Adam Johnson

@adamj.eu
3.4K followers 266 following 813 posts

🐴 @djangoproject.com blogger and contributor ✍️ Author of three books on Django and Git 🍕 Django London co-organizer 🇬🇧 London / 🇵🇹 Lisbon

PostsRepliesMedia
Adam Johnson @adamj.eu · 29/09/2026
For when crem doesn’t work:
A tub of “Sudocrem”, an antiseptic healing cream.

It gets to the root of the problem.
290
Adam Johnson @adamj.eu · 20/08/2026
We’re so back #htmx
051
Adam Johnson @adamj.eu · 07/08/2026
🎨 I’m really enjoying the redesigned PyPI project pages. Thanks to Nicole Harris and team for making these improvements! Blog post: blog.pypi.org/posts/2026-0... #Python
Django’s project page on PyPI, showcasing the new design.
070
Adam Johnson @adamj.eu · 27/07/2026
What do you see?
https://www.mixfont.com/experiments/decoy-font
361
Adam Johnson @adamj.eu · 31/03/2026
Nice IPython Easter Egg! 🏳️‍⚧️ #TransDayOfVisibility #Python
Running IPython today gives you the tip "Happy International Transgender Day of Visibility! You are valid. You matter."
050
Adam Johnson @adamj.eu · 22/01/2026
A packet of ~60 giga bites
A carton of four “Giga” apples (tagline: “mighty good”)
030
Adam Johnson @adamj.eu · 01/12/2025
4. Speed Up Your Django Tests If you spend ages waiting for CI runs to complete before you can merge, this is the book for you. It covers many useful ways to make your tests go brrrr, like profiling, parallelism, reducing setup work, and using in-memory storage and cache backends. #Django
Speed Up Your Django Tests
100
Adam Johnson @adamj.eu · 01/12/2025
3. Boost Your Django DX This book focuses on the tools and techniques that make developing with Django more productive. It covers installation tools, formatters, linters, development server packages, debuggers, and data setup tools. #Django
Boost Your Django DX: Tools and techniques to improve your development experience
100
Adam Johnson @adamj.eu · 01/12/2025
2. Boost Your Git DX This book covers deep and effective use of command-line Git. It covers aliases and extra tools that integrate with Git, like Less and delta, as well as many commands, from the basic 'add' and 'commit' to the more advanced 'rebase' and 'reflog'. #Git
Boost Your Git DX: Make your Git development experience super smooth
100
Adam Johnson @adamj.eu · 01/12/2025
1. Boost Your GitHub DX My newest book helps you find all the little tricks and shortcuts to make developing with GitHub more productive. It covers fundamental features like repositories, issues, and pull requests, and includes keyboard shortcuts and CLI commands to speed up common tasks. #GitHub
Boost Your Django DX: Tools and techniques to improve your development experience
100
Adam Johnson @adamj.eu · 08/10/2025
Yes! All versions down to 1.8 are available for offline instant search.
020
Adam Johnson @adamj.eu · 05/08/2025
🕰️ time-machine 2.17.0 is out! 🧀 support and wheels for Python 3.14 and free-threaded builds ➡️ new CLI to help migrate from freezegun to time-machine 📚 docs now on Read the Docs ✨ new retro-futuristic logo time-machine.readthedocs.io/en/latest/ch... #Python
time-machine logo, using the Back to the Future font
260
Adam Johnson @adamj.eu · 23/07/2025
My fantastic technology will fix up to 100% of your impossible problems.
Flash Magic Eraser packet, tagline: Erases up to 100% of impossible stains.
030
Adam Johnson @adamj.eu · 07/07/2025
I didn’t share for a while... here’s where BYGHDX is at: 250 pages as of yesterday. It’s approaching completion, with just Issues and PRs to cover before release.
Line chart of page count in Boost Your GitHub DX, climbing up to 250 pages on 6th July
100
Adam Johnson @adamj.eu · 03/07/2025
#Git mini tip: Use `git rev-list --count @` to count the number of commits in your repository, as reachable from HEAD (alias @). This command supports many of the commit limiting options available in `git log`, such as `--grep` to search commit messages. Full post: adamj.eu/tech/2024/11...
Two examples:

1. `git rev-list --count @` counting all the commits in the repository.

2. `git rev-list --count @ --grep "pre-commit autoupdate"` counting all automatic update commits from pre-commit.
180
Adam Johnson @adamj.eu · 01/07/2025
Met @anthonypjshaw.bsky.social and got ice cream in this UK heatwave!
Adam Johnson and Anthony Shaw presenting ice cream in London
0111
Adam Johnson @adamj.eu · 03/06/2025
Leake Street Arches #London #Graffiti
Black-and-white graffiti art of a female face by Abraham.OGraffiti art of a polar bear with a crown hovering over its head, by an unknown artist
010
Adam Johnson @adamj.eu · 25/04/2025
👨‍🎨 I made a logo for django-htmx too, what do you think? django-htmx.readthedocs.io/en/latest/ #Django
django-htmx logo
350
Adam Johnson @adamj.eu · 24/04/2025
🎨 django-upgrade now has a swish logo! 📖 And its documentation has moved to ReadThe Docs! 👉 Check it out at django-upgrade.readthedocs.io/en/latest/ #Django
django-upgrade logo
261
Adam Johnson @adamj.eu · 21/04/2025
#Git mini tip Limit the 'git log' to a certain time period with '--since' and '--until'.
Two commands:

1. 'git log --since 1.day.ago' to show commits from the last 24 hours.

2. 'git log --since 2025-04-01 --until 2025-04-08' to show commits in the first week of April 2025.
042
Adam Johnson @adamj.eu · 20/04/2025
#GitHub mini tip: Use the GitHub CLI command `gh issue develop -c` to create and checkout a local branch linked to the given issue. No need to name the branch, and when you later run `gh pr create`, the pull request will be linked to the issue automatically.
Example of running `gh issue develop -c`.
1324
Adam Johnson @adamj.eu · 16/04/2025
#Git mini tip: Acknowledge co-authors with a 'co-authored-by' trailer at the end of your commit message, like: co-authored-by: Otter Coder <otter@coolmail.example> GitHub, GitLab, and some other Git hosts will parse such trailers and show co-authors’ avatars alongside your own for that commit.
Example commit message showing two co-authors.
141
Adam Johnson @adamj.eu · 15/04/2025
#GitHub mini tip: Many gh (GitHub CLI) commands support -w (--web) to open the respective page in the browser. For example, 'gh pr view -w' opens the pull request for the current branch in the browser.
Running 'gh pr view -w', which outputs 'Opening https://github.com/django/django/pull/17554 in your browser.'.
050
Adam Johnson @adamj.eu · 14/04/2025
#htmx tip: Use htmx.logAll() to log all htmx events to the console. Great for debugging which events are triggering or not!
An example of running htmx.logAll() in the browser JavaScript console, followed by a log of events triggered by a button press.
0183
Adam Johnson @adamj.eu · 07/04/2025
3. Form `BoundField` customization. This change makes it easier to customize some parts of your forms’ rendered HTML, such as their <label> tags.
An example form with a custom BoundField class to add a CSS class to its <label> tag.
140
Adam Johnson @adamj.eu · 07/04/2025
2. Composite primary key support. You can now use relational databases’ support for tables with a multi-column primary key, unlocking better designs and interoperability with existing databases.
An example model using `models.CompositePrimaryKey`.
120
Adam Johnson @adamj.eu · 07/04/2025
Django 5.2 came out last week, yay! I’ve just written my round-up highlighting my favourite new features: adamj.eu/tech/2025/04... Quick highlights-of-the-highlights: 1. The shell command now imports your model classes automatically. You can customize this with more imports. #Django
./manage.py shell running and importing two model classes automatically.
1150
Adam Johnson @adamj.eu · 01/04/2025
#Python mini tip: The easiest way to create a signature-preserving function decorator is with `contextlib.contextmanager`. Use it on a generator function with one `yield` statement, and it will create a combined context manager and function decorator.
Example use of contextlib.contextmanager to create a function decorator that disables logging for the duration of the function call.
190
Adam Johnson @adamj.eu · 01/04/2025
Lots of quirky facts on the Wikipedia front page today en.wikipedia.org/wiki/Main_Page
010
Adam Johnson @adamj.eu · 31/03/2025
When #Git commit messages are meaningless
Hide the pain Harold running git blame

Harold forcibly grinning at commit message "updates", 7 years ago
1122
Adam Johnson @adamj.eu · 25/03/2025
+67 pages, +3 chapters, fresh beta sent out. If you're interested, let me know. Back to coding for the rest of the week.
Line chart of page count in Boost Your GitHub DX, climbing up to 167 pages on 25th March
130
Adam Johnson @adamj.eu · 25/03/2025
#GitHub tip: Don’t post “Any updates?” style comments on open source threads. Any updates would be there already. Open source is a gift; bugging maintainers acts like you're entitled to results. I just mark such comments as spam.
GitHub comment “Any updates on this?” being hidden as spam.
282
Adam Johnson @adamj.eu · 25/03/2025
Django + htmx tip: Use hx-headers to pass Django’s CSRF token with all requests. This allows htmx to make data-modifying requests with methods like POST or PUT. More details: django-htmx.readthedocs.io/en/latest/ti... #Django #htmx
Django template showing the body tag with the hx-headers attribute configured to add the CSRF token to all requests as the x-csrftoken header.
0110
Adam Johnson @adamj.eu · 22/03/2025
I added a "vibe-coding" reference in my GitHub book, on the chapter about GitHub-Flavoured Markdown... will this be the first book to mention the term? 😂 (By the way, this is showing the “Alert“ syntax: docs.github.com/en/get-start...) #GitHub #AI
Example of GitHub’s “Warning” alert Markdown that says “Vibe-coded“
290
Adam Johnson @adamj.eu · 21/03/2025
#Git mini tip: Enable `log.follow` globally to have `git log` always follow renames when checking the log for a single file. Otherwise, you need to remember the `--follow` option.
1. Enabling the option with `git config --global log.follow true`
2. Exmaple command, `git log example/widgets.py`, now follows file renames.
060
Adam Johnson @adamj.eu · 20/03/2025
It’s dangerous to #Git alone! adamchainz.gumroad.com/l/bygdx
It’s dangerous to Git alone! Take this:

Boost Your Git DX
020
Adam Johnson @adamj.eu · 19/03/2025
#Git mini tip: Use `git restore -p <path>` to interactively select parts of a file to restore. Press “y” to restore a hunk and “n” to skip it. This allows you to discard some changes from a file while keeping others.
An invocation of `git restore -p` showing a diff hunk that changed a variable and the prompt “Discard this hunk from worktree?”
290
Adam Johnson @adamj.eu · 18/03/2025
#Git mini tip: You can shorten SHAs to as few as their first four characters, and Git will still accept them. If the prefix matches two or more commits, Git will tell you. Short prefixes can save a lot of copy-pasting or typing when jumping from commands, such as from `git log` to `git diff`.
Two commands:

1. `git show b380` shows a commit.
2. `git show a721` fails due to the prefix being ambiguous. It lists two candidate commits, allowing the user to try again with a longer unambiguous prefix.
190
Adam Johnson @adamj.eu · 18/03/2025
I think this is a fake fact based on misreading the different standards between the US and the EU. From www.bbc.co.uk/news/magazin... :
A look at the different minimum standards for chocolate imposed in the US and the European Union might also lead someone to this conclusion. Milk chocolate in the EU must contain 30% cocoa, whereas in the US it need only
contain 10%. But these figures are very deceptive. The US requirement for 10% cocoa refers only to non-fat cocoa powder. The overall amount of cocoa, including cocoa butter, will be higher. In the EU, meanwhile, the requirement for chocolate to contain 30% cocoa refers to both cocoa powder and cocoa butter, so the
percentage of cocoa powder alone will be lower.So, how much cocoa does a Hershey's bar contain? According to Jeff Beckman, the company's director of corporate communications, it contains about 30% dry cocoa solids - cocoa powder and cocoa butter combined. About 1.5 times
as much as a bar of Cadbury's Dairy Milk.
120
Adam Johnson @adamj.eu · 14/03/2025
although then the isometric chart still doesn't load
100
Adam Johnson @adamj.eu · 13/03/2025
I hit the arbitrary 100 page threshold the last day I worked on the book, Tuesday, so today’s goal is to massage it into shape to send to the first wave of beta readers.
Line chart of page count in Boost Your GitHub DX, climbing up to 104 pages on 11th March
150
Adam Johnson @adamj.eu · 13/03/2025
#Git mini tip: Find commits by a particular author with `git log --author <name>`, which does a partial case-insensitive match on the author name and email address.
Running `git log --author Adam` to find commits by myself in Django.
120
Adam Johnson @adamj.eu · 12/03/2025
#Git mini tip: Use `git help -w <command>` to open the web help for that command in your browser (local copy, works offline!). Or run `git config --global help.format web` to make `git help <command>` and `git <command> --help` default to opening help in your web browser.
Screenshot of the web help for `git commit`.
160
Adam Johnson @adamj.eu · 11/03/2025
#Git mini tip: Use `git log --graph` with multiple branch names to reveal the branching connections between those branches. Or use `--all` to see all (local) branches.
Output of `git log --graph --oneline --all` showing the branching connections between three branches.
081
Adam Johnson @adamj.eu · 11/03/2025
What do you think of my placeholder covert art? 😂 #GitHub
Boost Your GitHub DX beta edition cover with “Cover art” in a spiral as the cover art.
130
Adam Johnson @adamj.eu · 10/03/2025
#Git mini tip: Use `git ls-files` to list all files in your repository. Add pathspecs (Git’s glob syntax) to filter the list.
Two commands:

1. `git ls-files` listing a bunch of files.
2. `git ls-files '*.rst' '*.py'` listing only files with those suffixes.
071
Adam Johnson @adamj.eu · 07/03/2025
Tracking my progress on the new book with a chart, updated for every day I work on it! #GitHub #Writing #BYGHDX
Title: Boost Your GitHub DX book page count
A line goes from ~15 pages on 23 February to 73 pages on 5 March.
190
Adam Johnson @adamj.eu · 25/02/2025
#AI #LLM
Person: Why should I read docs, books, or blogs when I can ask an LLM?

Angry goose: WHERE DID THEY GET THE TRAINING DATA?
160
Adam Johnson @adamj.eu · 25/02/2025
#Git mini tip: To show just the subject of a commit (the first line of its message), use `git show -s --format='%s'`. The `-s` suppresses the patch, and the `--format` option selects just the subject. By default, it shows the latest commit. Specify a commit reference to see another commit.
Two commands:

1. `git show -s --format='%s'` shows the subject of the latest commit.
2. `git show -s --format='%s' main` shows the subject of the commit referenced by `main`.
120
Adam Johnson @adamj.eu · 21/02/2025
#Git mini tip: Use `-U<n>`, where `<n>` is a number, to show n extra lines of context before and after diff chunks, instead of the default 3. I sometimes use `-U10` to bump it up to 10 lines to get a better sense of what exactly changed. This option works with `git diff`, `git log`, `git show`.
Three commands using the option:

1. `git diff -U10`
2. `git log -p -U10`
3. `git show -U10`
061