127.257 and other fun legacy IP addresses

I think I'm taking up a coat of arms. Source.

IPv6, the addressing scheme of the future, has been lacking adoption for decades now. Its complexity is an often cited reason: What's with the different kinds of addresses? What's fe80 supposed to be? And you can't even compare them properly, what with those pesky :: contractions!

Though ā€¦ did you know that 127.257 is interpreted as a valid IPv4 address by programs such as ping and your browser? Let's look into this.


Books: 2019-06

June was long, and hot, and not terribly filled with reading. I managed to read six books, and then I got stuck on Delany's Dhalgren. That one might take up a complete month ā€¦


Mobile Zammad notifications with Pushover

Both for my standalone work and for pretalx.com, I use the Zammad ticket system. Sadly, it includes neither a mobile app nor a usable mobile layout ā€“ but since I usually have my phone around, even when my laptop sits in my backpack/the next room/somewhere else, I wanted to see new tickets on my phone as they come in. Dismissing tickets I can look up later isn't particularly stressful for me, and well worth the opportunity to react to urgent tickets as fast as possible.


Using the Django shell with django-scopes

If you have a project where multiple tenants/users/groups share the same database, but should never interfere with one another, you're going to worry about making sure to prevent data leaks. I know, because I run this kind of setup with multiple projects, most notably pretalx, which uses Django.

As one measure of separating tenants, pretalx uses the new and wonderful django-scopes, which makes sure that models identified as scoped are only accessed in an active scope context. If this sounds interesting to you, please read the blog post introducing django-scopes ā€“ it explains the principles and limitations very well.

We started using django-scopes with pretalx, and we were pretty happy. Then, one day, I needed to look up some data that is not directly exposed in the frontend, for debugging purposes.


Index HTTP statūs numeri

Last night, when talking with a friend, I quipped

Django est omnis divisa in partes tres, quarum unam incolunt moduli, aliam visus, tertiam templates, qui exempli gratia DTL aut jinja2 appellantur.

This is a modification of the opening sentence of CƦsar's ā€œDe Bello Gallicoā€ regarding the Gallic war, where he explains that Gaul was at the time divided into three parts. Django, often described as a MVT (Model View Template) framework was a natural fit for this sentence and my late-night desire to find a practical application for my long and not always pleasant years of Latin.


Books: 2019-05

May was a very generic month. Did the working, did the volunteering, did the reading. Noticed that I am unhappy and figured out what to do about it, as you do. I didn't read as many books as I'd like, and none of them stood out too much.


Books: 2019-04

April was a travelling month: I spent all of five days at home, and the rest of the time I moved between Berlin, Copenhagen, Vienna, and Berlin again. While this was fairly stressful, it gave me plenty of time to read on the various trains and ferries I travelled on.


A @context decorator for Django

Even the happiest Django developers with the most ardent love of class-based views can get tired of writing super().get_context_data(**kwargs), only to add a couple of already-implemented properties or methods to the template context.

django-context-decorator provides, as the name may hint at, a decorator named @context. You can wrap it around both methods and properties, including Django's cached property, and it will add the property's value or the method's return value to your template context: