22 Sep 2026

feedDjango community aggregator: Community blog posts

Generalization as discipline

General code comes out better than code cut to fit one job, and its authors are the first to benefit. When we cannot afford all of it, the way down runs against instinct: work out the ideal shape first, then cut what today does not need, and keep a plan for putting it back.

Generalization as discipline

22 Sep 2026 10:00am GMT

21 Sep 2026

feedDjango community aggregator: Community blog posts

First Aid Kits: Bleeding Control & Tourniquets

Should you put a tourniquet in your first aid kit? Maybe, but you should know some things before you do:

So what do I do?

I have tourniquets in two places:

  1. In my shop. I have a table saw in there, and several other things that spin sharp metal at high speed.
  2. In a small first aid pouch that I wear on my belt when I'm using my chainsaw.

Both of those bleeding control kits also have an Israeli bandage, vetwrap, and gauze. I probably ought to have gloves but I don't; the person doing the bleeding is going to be me or a loved one, and I can't be bothered to keep replacing them as they get all gross and sticky from the heat.

None of my other first aid kits have tourniquets. My backcountry kits don't need them; I'm not going to encounter a situation in the wilderness that requires a tourniquet. (I would add one if I went on a hunting trip.)

There's an argument to be made that I should carry one in the kit in my car - because I have emergency medical training, I'd want to stop and help if I witnessed a traffic accident, and those are situations where perhaps a tourniquet could make a difference. However, I'm concerned that the heat of the car will degrade the tourniquet faster than I'd expect, and so if I did apply it, it could fail. And I'm confident enough in my ability to control bleeding with pressure until EMS arrives.


Was this helpful? I've been thinking about writing a longer series about first aid kits (how I think about building them, and what goes in mine), of which this could become a part. If that's something you'd like to read, get in touch.

21 Sep 2026 5:00am GMT

19 Sep 2026

feedDjango community aggregator: Community blog posts

Python: join my optimization workshop in Lisbon, 10th October

I'm running a workshop in Lisbon next month, and you're invited!

It's a small, in-person, hands-on session on optimizing Python code, with a Django flavour. Here are the details:

Register on Luma

What we'll do

In my experience, Python projects often have some easy performance improvements waiting to be found, from client projects to large open source projects like Django itself. This workshop is designed to teach you how to find the hot spots worth optimizing, using these three tools in a loop:

  1. Capture a profile with cProfile, Python's built-in profiler.
  2. Drill into it with profiling-explorer, to find where the time actually goes.
  3. Prove your change worked with tprof, which measures just the functions you care about and can compare before against after.

I'll teach the loop end-to-end on a real example. Then we'll spend most of the morning using it for real, and you can pick your target:

  • Django itself.

    I'll bring a small collection of potential optimization targets in the Django codebase. You can try out the loop optimizing them, figure out if there are safe and worthwhile optimizations to be made, and potentially make a pull request to Django itself. I'll help shepherd the promising ones towards being merged after the workshop.

  • Another project.

    If you'd rather point the tools at something else, like another open source project or a work codebase, feel free. We can still work together to find some gems.

We'll try working in pairs, and at points we can chat as a group to compare notes on what we've found.

There's a break in the middle, with coffee, tea, and pastries provided.

Who it's for

Intermediate and experienced Python developers. Django experience is helpful, especially if you want to work on Django itself, but it isn't required. The tools and the loop are plain Python, and the "your own project" track works with any codebase.

You don't need to have profiled anything before.

What to bring

A laptop, with Git and a recent Python version installed. I'll send setup instructions to everyone who registers, a week or so beforehand. It only takes a few minutes, but please do it before you arrive, so we can spend the time on the interesting parts.

This is a workshop, not a talk, so we'll be talking and coding together throughout the session.

Register

Register on Luma

There are only ten places in order to keep the session manageable, so please stick to your registration.

Fin

I hope to see you there.

Optimize all the things!

-Adam

19 Sep 2026 4:00am GMT