Today I Learned

Short TIL posts

1834 posts latest post 2026-04-18
Publishing rhythm
Apr 2026 | 20 posts

A feature of jinja that I just discovered is including sub templates. Here is an example from the docs.

{% include 'header.html' %} Body goes here. {% include 'footer.html' %}

And inside of my thoughts project I used it to render posts.

<ul id='posts'> {% for post in posts.__root__ %} {% include 'post_item.html' %} {% endfor %} </ul>

note that post_item.html automatically inherits the post variable.

I am trying to use htmx on a new fastapi site for my thoughts, and have been hitting this error.

Mixed Content: The page at 'https://front.mydomain.com/#/clients/1' was loaded over HTTPS, but requested an insecure resource 'http://back.mydomain/jobs/?_end=25&_order=DESC&_sort=id&_start=0&client_id=1'. This request has been blocked; the content must be served over HTTPS.

What is happening #

I have an htmx component that gets the current users name, but if they are not logged in the backend redirects to a login form.

<div hx-get='/users/me' hx-trigger='load'> get me </div>

But for some reason when the front end gets this redirect, it tries to do it through http,...

...

On void linux. Under `/etc/containers/` there is a file called `registries.conf`. It is complemented by `man 5 containers-registries.conf`. Change (for me lines 11-12) which say [registries.search] registries = [] to

[registries.search] registries = ['docker.io']

(drawn from https://www.projectatomic.io/blog/2018/05/podman-tls/)


Without the above you won’t be able to use basic podman functions. You might get errors like:

Various documentation (redhat blog entries, man podman pages) say that dockerhub is a default, but without this step it’s clearly not.

Good luck. Feel free to use the comment box below if you have a github account.

...

Here is a snippet provided by @tiangolo to store the users jwt inside of a session cookie in fatapi. This was written in feb 12, 2020 and admits that this is not a well documented part of fastapi.

It’s already in place. More or less like the rest of the security tools. And it’s compatible with the rest of the parts, integrated with OpenAPI (as possible), but probably most importantly, with dependencies.

It’s just not properly documented yet. 😞

But still, it works 🚀 e.g.

![[None]]

When setting up a new machine, vm, docker image you might be installing command line tools from places like pip. They will often put executables in your ~/.local/bin directory, but by default your shell is not looking in that directory for commands.

WARNING: The script dotenv is installed in '/home/falcon/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

To solve this you need to add that directory to your $PATH.

export PATH=$PATH:~/.local/bin

To make this change permanant add this line to your shell’s init script, which is likely something like ~/.bashrc or ~/.zshrc.