A couple of years ago, I got lucky and found Daniel Roy Greenfeld's dj-notebook project thanks to a reddit post. I wrote about it here. It's held up well. I still find it very useful in almost any context where I'd run python manage.py shell to help me understand what's going on with a django site. My preferences for using notebooks have evolved since then, though. Lately, I find marimo notebooks…
Even though simple django templates can take you very far, sometimes it's nice to use packages from the npm ecosystem. And if you're using tailwind, unless you're pulling a huge development bundle, you already need a build step. vite is a great improvement to all of this, but it still leaves you needing to both run the vite development server and the django development server in order to develop…
More and more school flyers are sent home with QR codes instead of clickable links lately. Since I usually read these flyers on my laptop (currently running Mac OS Sequoia) that introduces an annoying extra step. Frequently, I'll just pull out my phone, use the reader to open the link, and airdrop that back to my MacBook. Today a new flyer came in while I didn’t have my phone with me.
The django project announced some important security releases today. I have a few production applications running django, and while none of them were due for a release today, these updates seem like they could be necessary for me. And I had to look up how to update these when I'm not changing a version constraint, so I'm writing it down here in hopes that I'll make it more memorable. My newer…
It's not a super-frequent need for me, but sometimes I'd like to be able to accept markdown from users and include the rendered output on my site. This is risky, because markdown can include arbitrary html, and libraries that process it may not focus on making sure it's safe to include in a site. For a while, bleach was the common recommendation, but it's deprecated. Since then, the ammonia…
Now that I can build my static site and serve it up using Caddy inside a docker container, it's time to publish it to a server on the internet. If I didn't want to host other things with it, at this point, I'd just stop and throw it on a static host somewhere, either like github pages, gitlab pages or sourcehut pages. Or a shared hosting space at nearlyfreespeech.net. But I want to publish some…
I want a valid new Django secret key just often enough to need to know how to generate one quickly and easily but not quite often enough to remember it. I'm pasting the one-line command here, in hopes that I'll remember it or find it faster. (The pipe to pbcopy is Mac-specific; substitute your desktop's equivalent.) uv run python -c 'from django.core.management.utils import get_random_secret_key;…
While using kamal, some of my mounts weren't working as expected. Search engines were a little bit unhelpful in determining what was going on, and I muddled my way through. I'm posting this in hopes that it makes search engines more helpful for future-me or future-someone-like-me. More seasoned docker veterans probably wouldn’t have needed to turn to a web search to figure this out, but…
Over the past several months, I've opened up to the idea of using ansible and kamal to manage VPSes where I host sites that I want to make accessible to the public. Now, I'm setting up a new service that includes a basic static site, where I need a way to easily share files with people. For other similar static sites, I've been using a shared host or my git forge's "pages" service.
Almost every time I build a web gadget, I need to send a few emails. Making sure those messages are sent when they should and look the way they should is a real weak point of django tooling, IMO. Mailpit is an easy way to run past that. The main reason I’m writing this down and posting it is that I keep forgetting about it and rediscovering it. It feels like a very intense need for a very…
Today I'd like to experiment with some nice interfaces for tagging and showing tagged bookmarks. But it feels too clunky to log into the django admin then navigate back, so first I want to get Django authentication set up. I suspect that if this turns into something I want to share with others, I'll eventually wind up with allauth, but that feels too heavy for now. And setting up Django's built-in…
In order to further iterate on Fischer, I'm going to need to be able to test with a reasonably large pile of bookmarks. That's going to get tedious quickly if I can't import and export them as I experiment. In the past, the shortest path to doing this has been using django-import-export and either a script or django admin integration. I'd prefer a script for this, so I'm also going to use…
In Part 1, I learned how to do views and routes in nanodjango, got some basic templates set up, and vendored Pico CSS to make those pages look a little nicer. Tagging is going to be an important part of making this all work the way I want, and the easiest way to solve that is with django-taggit. I'm tackling this next so I can learn whether adding a third-party app means I need to go ahead and…
I know there are a few new practices that I should adopt as I start new projects, but part of the purpose of this one is trying out nanodjango. So I’m keeping my other stuff the same, including pyenv, black, and poetry usage, for now in order to save my “innovation tokens.” Some Quick Ceremony to Make a Comfortable Environment cd fischer git init . gibo dump MacOS JetBrains…
Lately, I find myself missing the dynamic start pages we used to set for our browsers in the late 1990s. The ones I liked eventually turned into search engines, got crapped up by ads, or just plain went away. All of the above, in many cases. For a while, I didn’t miss them, because feed readers and synchronized bookmarks kind of took their place, for the most part. But now I find myself…
For the first time in quite a while, I caught the urge to publish a package to pypi today. The happy path for publishing a pure python package felt less obvious than I think it should’ve. Here’s what I did. The package in question is published here, and the source code is available on sr.ht. It’s the beginning of a youth baseball season. One of the things I do is help our…
After a few years' layoff, I’m playing fantasy baseball again in 2024. Not only is this league quite a bit different from the one I used to play, the online resources for player research have changed over the past few years. This post collects some things that seem useful to me. Fangraphs has grown and changed quite a bit. Baseball Prospectus still seems good, but a lot of it is paywalled…
I’m blogging today’s yak shaving exercise because I found web searches challenging for some of this. And hopefully writing them down here will both help improve those searches and help me remember. Also, I am determined to blog more in 2024. This post really is mostly about snags in my Alpine Linux upgrade adventure, but I’d like to share some back-story first. How I Got Here My…
This year, I’ve really started to like jupyter notebooks. I first tried them out several years ago, but they’ve only just started to click for me. They haven’t changed; the difference is how I think about them. When I initially tried them, they felt like writing untestable code in a browser, where you could get yourself into an unknowable state very easily as you navigated…
I’m working through Hypermedia Sytstems using django and htmx in public. This post starts applying the patterns from Chapter 6: More Htmx Patterns. In the last post, I finished working through Chapter 5. If you haven’t read the prior posts, they’re linked from the introductory one. The code can be found on sr.ht. To pick up where this post does, start from the tag pagination. Now…
I’m working through Hypermedia Sytstems using django and htmx in public. This post continues to work through Chapter 5: HTMX Patterns. In the last post I finished the data validation parts of the chapter. If you haven’t read the prior posts, they’re linked from the introductory one. The code can be found on sr.ht. To pick up where this post does, start from the tag…
I’m working through Hypermedia Sytstems using django and htmx in public. This post picks up with Chapter 5: HTMX Patterns. If you haven’t read the prior posts, they’re linked from the introductory one. The code can be found on sr.ht. To pick up where this post does, start from the tag contacts-app-web1.0. Even though it’s possible (and reasonable!) to integrate htmx without…
I’m working through Hypermedia Sytstems using django and htmx in public. This post covers building out the Web 1.0 edition of the book’s contacts app. For background on this series of posts, see the introduction. To follow along with the code, you can access the repository at sr.ht. If you’d like to follow along starting here, check out the “boilerplate” tag from git.…
Carson Gross, Adam Stepinski and Deniz Akşimşek have recently published their work, Hypermedia Systems and have generously made its entire content available online without any fee. Over the past two years or so, I’ve found myself reaching for HTMX more often when I build sites. It’s been a really nice way to work, but I’ve definitely learned it ad hoc. Since there’s now…
A friend recently very generously gifted me a flipper zero, and it’s been a lot of fun to kick the tires. After exploring the stock firmware for a while, I wanted to customize it more than was possible with stock firmware, play with some apps people have built, and try my hand at running my own code on there. Initial Setup First, I grabbed a microSD card, formatted it, installed qflipper on…
Over the past week or so, I’ve been trying out using Docker to deploy a Django site on a VPS. My preferred setup for that is to have Caddy running on the host, not in any container, as a reverse proxy. (It’s a single, static binary; I don’t see any joy in wrapping that in a container.) In the past when I’ve hosted similar things, I just ran gunicorn in a python virtualenv…
Aside: I let my need to stop the reading journal project for a while make me pause my blog posting as well. That was unintentional. I still plan to post 100 posts this year even if that series needs to wait. My first open source contributions are old enough to have a beer in the US by now, as is my first python code. But I’ve always found it awkward and disruptive to patch, and contribute a…
As I’ve mentioned a few times, HTMX is really growing on me for building web things lately. When stacked on top of Django, it lets me mostly write server side code, which is my comfort zone, but get pages that load and behave the way people expect them to in 2022. It doesn’t free me from all need to write stuff that runs in the browser, though. Here’s what I’ve found useful…
In part 4 of this series, we got forms in place to add and edit books in the library, then made them look better using django-crispy-forms. The many-to-many relationship between books and authors brought some weaknesses of the Crispy Tailwind theme to light, and it took a bit of effort to address that. Now it’s time to get deletion working before we make everything work a little better using…
In part 1 and part 2, we got the basic project workflow set up. Part 3 saw some initial models and views that were tested using the Django admin UI. Now it’s time to add library CRUD to the reading_log application itself. Where code is discussed below, I try to copy everything that’s relevant inline. I’m sure I missed a few things. The entire project is available here. Library…
I’m blogging this because I find myself looking it up repeatedly. Every time I start a project, I eventually hit a point where I use the REPL quite a bit. Usually I want to use it from PyCharm’s python console. And I usually find myself manually typing 5 or 6 commands at the start of each session that shell_plus from django-extensions would give me for free. This answer on this…
In part 1 and part 2, we got the basic project workflow set up. Now it’s time to add some basic models and views. Tweak tailwind.config.js Before we get into the meat of this, it’s necessary to alter the tailwind configuration so that the tailwind CLI will look for templates in subdirectories. This is only necessary because of how I choose to structure my templates; if you use a…
How I Start: Django, Tailwind, HTMX (part 2) In part 1, I set up the project, a sensible .gitignore, tailwind, and live reloading along with some run targets for PyCharm. Now it’s time to finish up the housekeeping. Housekeeping: Move Configuration into the Environment This doesn’t strictly need to be done at this early stage, but I find that doing so is a protective habit, especially…
How I Start: Django, Tailwind, HTMX (part 1) I wanted to try out some "modern" front-end development for a while, and I did. FastAPI is great. So is Svelte. But even though I found creating APIs that way to be a breeze, building a whole site that way felt much slower and heavier than using traditional server rendering. So I decided to give django a fair shake for a while, and I’m glad I did.
I feel like restarting the blog. Let’s see how long it sticks this time. My goal is at least 100 posts in the next 12 months. I have, on multiple occasions, harbored ambitions of making this blog a daily thing. Clearly, I’m not built for that. But after not posting for a while, I feel like it’s worth trying things out again, with another run at #100DaysToOffload. Last time I set…
About every two or three months I need to write a regular expression that’s complex enough I don’t get it correct on my first try. Then I search for this site, and wish I’d just started writing my expression there. I hope that writing it down and posting it here will help me remember that next time.
For trying out new things, sometimes I want to make them accessible from the internet. I’ve got a small reverse proxy VPS on one of the cloud hosts. This is how I currently set them up on a VM in my basement and expose them via that proxy. Writing out all the steps from install to accessibility makes this seem like a lot of work, but it isn’t hard and goes quickly.
My toy stock toolkit application is “feature complete” for now. I’m very happy with both the quality of the tooling and the ease of using it. Svelte combines well with Tailwind and lets me get things done on the front end more easily than I imagined. This post summarizes what I made along with what I’ve learned. My code is available in this repository. Bear in mind it is…
Part of the appeal of Smelte was Tailwind CSS integration. After going back and trying Smelte some more, I concluded that it’d be easier to use Tailwind directly, at the cost of giving up some very convenient widtgetry. The Smelte widgets aren’t comprehensive enough to use them all alone, and their customization of Tailwind makes it too hard to integrate things that rely on the vanilla…
I took a detour to try out the Smelte/Tailwind CSS UI gadgetry. I found lots to like about it, but it’s not the right thing for me right now. Read on if you’re interested in the detour. If you’re trying to follow how I got to my end state, go here instead to see how I set things up for vanilla Tailwind. Adding Smelte and Tailwind CSS I’m not a web designer, and I have no…
Front-end development is the area where I feel most out-of-date today. While none of the technologies at play are exactly alien to me, I usually don’t do anything more elaborate than some templated HTML mixed with vanilla javascript plus jquery and bootstrap CSS. But while those sites are functional and even look OK sometimes, they often lack the kind of reactivity that really became table…
As I’ve been trying to update the tools I lean on for quick web things, I am really enjoying using FastAPI with Svelte. These are notes about the development setup that I currently like. Fair warning: this is not battle hardened yet. I’ve used it to make a couple of toys and like how it’s shaping up, though. I give an overview of the stack here. I’m still mainly talking…
As I’ve been trying to update the tools I lean on for quick web things, I am really enjoying using FastAPI with Svelte. These are notes about the development setup that I currently like. Fair warning: this is not battle hardened yet. I’ve used it to make a couple of toys and like how it’s shaping up, though. I’m mostly trying to capture the setup I like for local…
Since I need to prototype a few web tools in the near future, I’ve been casting around to update the stack I use for that. The last time I consciously did that was several years ago, so I’ve had a lot to experiment with in order to catch up and land on some new practices that will help me quickly try out ideas in a way that will be appealing to use and to maintain in 2020 and 2021.
Now that I’ve coached my kids and their friends for a few seasons, I have a fairly well-developed routine for getting ready for practices and games. Every time I do it, I’d like an app to help me with the following: Take scratches from the online RSVPs Randomize my batting order For teeball/rookies, make sure I’m spreading the fun of batting first and last around the team evenly…
I’ve been a little choosy about what’s allowed on my network for quite some time. Back when we were trying to adopt Ace the hound, I picked up a camera from Micro Center called the “Yi 1080p Home Camera”. It cost around $20 at the time, and claimed some great features. I did not expect that I was going to be happy with its activity on my network, but my need for it was…
This week, I needed to declare the KDE experiment a failure. While there are many ways in which I prefer it to GNOME, there are just as many annoying quirks that I did not manage to tame or get used to. Since Fedora 33 is about to ship, Fedora 31 is about to become unsupported anyway, so it seemed like a good time to upgrade. Out of laziness, I decided to do a clean install.
Over the past couple of years, I’ve felt like what is currently called “front-end” web development is a tremendous blind spot for me. It just so happens that current world events leave me curious about some data that is widely available via public APIs. My personal desire to understand some of the information about the world that those APIs expose makes this a nice, organic…
I’ve needed to write something similar to this down before. Since I got used to that dance, it hasn’t been much hassle to keep VMWare humming away on my Fedora laptop. Maybe that’s because I don’t use it as heavily as I used to. Today I wanted to use the Workstation client to control my ESXi server. And it wouldn’t launch at all. Not only that, the vmware-modconfig…
As good as existing editing tooling for LÖVE2D, sometimes source debugging is hard to beat. I don’t feel the strong need for an IDE; the tooling available for vim and VSCode is excellent for editing, reading and running these games. But especially without a compiler, it can be really helpful to be able to set breakpoints and inspect values at runtime. After the most recent GD-50 project, I…