Adam Johnson's Avatar

Adam Johnson

@adamj.eu.bsky.social

🐴 @djangoproject.com blogger and contributor ✍️ Author of three books on Django and Git πŸ• Django London co-organizer πŸ‡¬πŸ‡§ London / πŸ‡΅πŸ‡Ή Lisbon

3,191 Followers  |  251 Following  |  577 Posts  |  Joined: 15.10.2023  |  2.1614

Latest posts by adamj.eu on Bluesky

it's just a matter of people digging into the problem and working on it, slowly and steadily.

06.08.2025 13:47 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

It’s common for folks to turn to a complete reset like this, with several posts like this over the years. There's even this package from @browniebroke.com : pypi.org/project/djan... .

It would be better if we could improve squashmigrations to handle the circular dependency case. It's possible...

06.08.2025 13:47 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

πŸ˜‚ wait til version minus one

05.08.2025 18:15 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
time-machine logo, using the Back to the Future font

time-machine logo, using the Back to the Future font

πŸ•°οΈ 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

05.08.2025 15:32 β€” πŸ‘ 6    πŸ” 0    πŸ’¬ 2    πŸ“Œ 0

TIL!

05.08.2025 14:22 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Nice one! A bunch of well written examples to point new Pythonistas to.

04.08.2025 00:30 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

hahaha wtaf

04.08.2025 00:28 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Django: write a custom URL path converter to match given strings - Adam Johnson Here’s a little tip based on some work that I did recently. The project has a URL pattern where the first part of the URL matches the current role the user is viewing the site as. Let’s say the roles ...

✍️ New post on one use case for custom path converters in Django.

adamj.eu/tech/2025/08...

#Django

01.08.2025 23:20 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

😎

01.08.2025 16:56 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Heard today about Boost your Git DX from @adamj.eu. Bought it. Read one section, about delta. Shared the tool and the recommended config with colleagues -> they loved it.

Promising for the next chapters!
adamchainz.gumroad.com/l/bygdx

31.07.2025 18:07 β€” πŸ‘ 1    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

bsky.app/profile/adam...

30.07.2025 17:55 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Python: check a package version with importlib.metadata.version() - Adam Johnson Sometimes, it’s useful to branch the behaviour of your code based on the version of a package that you have installed. This may be to support an upgrade in your project, or for your own package to sup...

✍️ New post on checking package versions with 'importlib.metadata.version()'.

This is a modern replacement for checking package __version__ attributes.

adamj.eu/tech/2025/07...

#Python

30.07.2025 17:55 β€” πŸ‘ 11    πŸ” 2    πŸ’¬ 0    πŸ“Œ 2
Preview
Django: split ModelAdmin.get_queryset() by view - Adam Johnson Within Django’s popular admin site, you can override ModelAdmin.get_queryset() to customize the queryset used by the admin views. It’s often used for performance optimizations, such as adding a select...

✍️ New post on targeting optimizations within Django ModelAdmin.get_queryset()

Just a small tip on making different optimizations depending on the current admin view.

adamj.eu/tech/2025/07...

#Django

30.07.2025 17:14 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Gradian - Wikipedia

thanks!

wtf gradians??

en.wikipedia.org/wiki/Gradian

30.07.2025 10:16 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Apparently the UK adult verification thing has basically banned blind people from half of the internet because they can't use the verification system 🫣

29.07.2025 09:51 β€” πŸ‘ 2945    πŸ” 1061    πŸ’¬ 48    πŸ“Œ 76

brilliant! It's definitely a lot smoother to play now.

26.07.2025 16:54 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

macbook, firefox

26.07.2025 16:18 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I played easy mode, it was fun, thanks!

Suggested improvements:
* Increase the font size of the grid - I zoomed to 200% to play
* Make 8 and B more visually distinct colours
* Make it possible to type characters to fill cells

🍻

25.07.2025 21:38 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 2    πŸ“Œ 0

Ouch! Good luck and get well soon...

24.07.2025 21:44 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Initially, I found that some random bug was erasing my zsh history every few months, which got frustrating.

Now I've started using it, I've found the per-Git-repo histories super useful, and I made it my default. I jump between projects which differ in how to invoke their tests, etc.

23.07.2025 20:41 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Jujutsu - A Git-compatible VCS - Martin von Zweigbergk | GitMerge 2024
YouTube video by GitButler Jujutsu - A Git-compatible VCS - Martin von Zweigbergk | GitMerge 2024

Oh cool! The demo video really got me wondering, but I've not made the time to properly try it out

www.youtube.com/watch?v=LV0J...

23.07.2025 20:39 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Flash Magic Eraser packet, tagline: Erases up to 100% of impossible stains.

Flash Magic Eraser packet, tagline: Erases up to 100% of impossible stains.

My fantastic technology will fix up to 100% of your impossible problems.

23.07.2025 20:37 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

🀘 Always fun to join Test & Code and rock out with that intro music

22.07.2025 20:36 β€” πŸ‘ 3    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
pytest-randomly/CHANGELOG.rst at main Β· pytest-dev/pytest-randomly :game_die: Pytest plugin to randomly order tests and control random.seed - pytest-dev/pytest-randomly

All of my packages don't have a __version__ attribute, they just set version in pyproject.toml. Users can use importlib.metadata.version() if they need to check their versions.

Looks like I removed the attributes in 2019: github.com/pytest-dev/p... . No one ever complained.

22.07.2025 18:01 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I removed __version__ attributes from all my packages... There’s now importlib.metadata.version() to retrieve them for arbitrary packages, so I don't see why packages should also go out of their way to maintain them.

That said, it's neat that setuptools makes it so easy!

22.07.2025 14:50 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
Django: iterate through all registered URL patterns - Adam Johnson I’ve found it useful, on occasion, to iterate through all registered URL patterns in a Django project. Sometimes this has been for checking URL layouts or auditing which views are registered.

✍️ New post on iterating through registered URL patterns in Django

This is a trick I’ve reached for a couple of times, so I thought I’d write it up.

adamj.eu/tech/2025/07...

#Django

22.07.2025 14:47 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Thanks!

21.07.2025 10:13 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Git: find the largest commits - Adam Johnson Recently, I was working in a new repository and found the git blame output often pointed back to a large repository-wide formatting commit (applying Black to all Python files). To ignore this commit i...

✍️ New post with a script for finding large commits in Git repositories.

I used this in a new repository to find commits worth ignoring in `git blame`.

adamj.eu/tech/2025/07...

#Git

20.07.2025 16:24 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Python: fix BrokenPipeError when piping output to other commands - Adam Johnson If you’ve written a Python script that outputs a lot of data, then piped that output into another command that only reads part of it, you might have encountered a BrokenPipeError. For example, take th...

✍️ New post on fixing BrokenPipeError in Python scripts.

Python raises this exception when you pipe its output to a command that closes the pipe early, like 'head'.

BrokenPipeError has annoyed me for years, and finally I found a fix in the Python docs!

adamj.eu/tech/2025/07...

#Python

20.07.2025 15:51 β€” πŸ‘ 5    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0

Living

20.07.2025 09:02 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@adamj.eu is following 20 prominent accounts