Personal blog for Anders Hovmöller. Mostly programming stuff.| En kodare
Update: Read the updated blog entry for how we do this now| En kodare
I’m a big fan of Django, but it has too many silent failure modes. This is very bad for beginners, and it’s not good for veterans either. I make these types of mistakes on an almost daily basis.| En kodare
I think we’ve all seen abandoned projects that have multiple good pull requests. Sometimes there is an active fork but it can be extremely hard to find, even if you spend the time to go looking. I believe this is a problem that can be fixed, or at least improved upon significantly.| En kodare
I use this expression a lot. I think I got it from Penn & Teller’s show Bullshit! specifically the episode on anti-vaccine activists. It’s a fun mental tool that is very useful and I’ve found most people don’t have. The basic tool goes something like:| En kodare
The iommi docs are more correct than most projects because we take a different approach to documentation: part of the test suite is the documentation. Let’s look at an example:| En kodare
Transparent APIs is a pattern/philosophy me and my colleague Johan Lübcke have developed. It’s especially nice for building GUIs but is also generally useful in some other cases.| En kodare
(Update 2024-09-28: This blog post is a bit outdated, but still shows some of the philosophy that is now a part of iommi.) I think Object Oriented Programming is overused, but I have to admit it is unrivaled for certain tasks, the most significant to my line of work being GUIs. But OOP as normally practiced in languages like Python, Java, and C++ have some clear drawbacks even for this use case. One problem for GUIs is that you need to create lots of classes even for trivial things: when you ...| En kodare
In Django 5.2 we got a way to easier customize attributes of forms. Adam Johnson posted an example on mastodon, which I’ve slightly abbreviated below:| En kodare
Phil Gyford wrote an article about how nice it is that the Django admin pre-populates inputs from the GET parameters if there are any. This can be used for bookmarklets as in his examples, or just general bookmarks where you can quickly go to a page with parts of a form prefilled.| En kodare
At Dryft I have the luxury of a small production database, so I can mirror prod to my local dev machine in ~3 minutes. I use this a lot to get quick local reproduction of issues. I used to copy-paste the relevant URL part to my local dev and felt quite happy with it. Then I realized that I could just paste the entire URL after http://localhost:8000/! My browser autocompleted that part anyway, and URLs like http://localhost:8000/https://[...] are obviously invalid for normal uses cases, so can...| En kodare
Personal blog for Anders Hovmöller. Mostly programming stuff.| En kodare
There’s a lot of tools out there to automate taking screenshots for documentation of web apps/libraries. Screenshots are certainly sometimes a good idea, but they have some serious downsides:| En kodare
Personal blog for Anders Hovmöller. Mostly programming stuff.| En kodare
Managing URL mappings in Django can become a bit of a mess as a project grows, and you often end up with many tabs in your editor named urls.py which is not very helpful. In several discussions on the Unofficial Django Discord, cb109 kept mentioning that he’s got a single big urls.py file. At some point I started noticing every time I navigated to the wrong urls.py and how I got a little annoyed every time.| En kodare
This question popped up on the Django Discord:| En kodare
Carlton Gibson has released a package called Neapolitan to make it easier to do CRUD stuff in your app. The short description:| En kodare
The most annoying thing with traditional server rendered HTML is that saving forms scrolls to the top. This brings the user out of flow when there are validation errors. The most common solution is to go full Single Page Application, but that loses the correct reload-for-POST behavior of the browser. There is a much easier way.| En kodare
Something I hear a lot is that iommi is weird (or “magical and weird”). I would maybe use the word “different”, but it’s true!| En kodare