Adam Johnson

Home | Blog | Training | Projects | Colophon | Contact

Posts tagged ‘django’


Backporting a Django ORM Feature with Database Instrumentation

Backwards like this ancient “lizard”

Last week I covered Django’s database instrumentation, and making a wrapper that’s always installed. Here’s a different use case that I encountered last year on a project.

Read more...

How to Modernize a Django Index Definition with Zero Downtime

Book Index

If you’ve read the Django documentation for Model.Meta.index_together recently, you may have noticed this note:

Read more...

How to Make Always-Installed Django Database Instrumentation

Mandolin

Since version 2.0, Django has provided a hook for installing database instrumentation wrapper functions. These functions are like middleware for database queries, allowing you to inspect and rewrite SQL before it is sent to the database. There are many use cases, for example:

Read more...

How to Use Django's Parallel Testing on macOS With Python 3.8+

Fork or Spoon?

This post is an adapted extract from my book Speed Up Your Django Tests, available now.

Read more...

Fun with GPT-3

Deep, deep learning

Here’s a conversation I had earlier with the late Ernest Hemingway:

Read more...

Disable Instrumentation Packages during Tests

Don't be a sheep with your instrumentation

This post is an adapted extract from the Easy Wins chapter of my book Speed Up Your Django Tests, available now. This tip could take 8% off your tests' run time with a small configuration change!

Read more...

Announcing a Regional Discount for “Speed Up Your Django Tests”

Going Global

Since I launched my book Speed Up Your Django Tests I’ve had a number of questions about possible discounts. I want to make my book affordable for all and understand that $49 is a high price tag for some. The Django community is global and I want to share knowledge with Djangonauts everywhere.

Read more...

Why does Python raise ModuleNotFoundError when modifying Django's INSTALLED_APPS?

Pegasus, chained

Imagine we are installing the third party package django-cors-headers, which I maintain. Step one in its installation process is to install the package, so we run the command:

Read more...

How to add a .well-known URL to your Django site

The Owls Know Well

The /.well-known/ URL path prefix is a reserved name space for serving particular static files used by other systems that might interact with your site. It was established by RFC 5785 and updated in RFC 8615. The IANA maintains a list of possible files in the Well Known URIs registry, but others are in wide use without official registeration (yet?).

Read more...

How to Unit Test a Django Form

Test this bit, this bit, and this bit

This post is an adapted extract from my book Speed Up Your Django Tests, available now.

Read more...

All tags: