Django, HTMX, and front-end scripting

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 lately.
Read more →

How I Start: Django, Tailwind, HTMX (part 5)

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 HTMX.
Read more →

How I Start: Django, Tailwind, HTMX (part 4)

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.
Read more →

Adding shell_plus for Django to PyCharm’s Python Console

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.
Read more →

How I Start: Django, Tailwind, HTMX (part 3)

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.
Read more →

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.
Read more →

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. Here’s how I currently like to get a site started with django, using Tailwind CSS for responsive layouts and styling, and mixing in alpine.js and HTMX to make the site feel reactive. I’m glad I gave the backend/frontend split an honest try, but this fits the way I think about sites better.
Read more →

Is This Thing On?

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.
Read more →

A Nice Regex Tester I Keep Needing To Search For

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. If you’re havin' perl problems…
Read more →

Hosting Side Projects in my Basement

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.
Read more →