Readit News logoReadit News
divbzero commented on Static sites with Python, uv, Caddy, and Docker   nkantar.com/blog/2025/08/... · Posted by u/indigodaddy
nkantar · a day ago
Author—though not OP—here. I’ll try to broadly address the questions, which are all fair.

Broadly speaking, I explicitly wanted to stay in the Coolify world. Coolify is a self-hostable PaaS platform—though I use the Cloud service, as I mentioned—and I really like the abstraction it provides. I haven’t had to SSH into my server for anything since I set it up—I just add repos through the web UI and things deploy and show up in my browser.

Yes, static sites certainly could—and arguably even should—be done way simpler than this. But I have other things I want to deploy on the same infrastructure, things that aren’t static sites, and for which containers make a whole lot more sense. Simplicity can be “each thing is simple in isolation”, but it can also be “all things are consistent with each other”, and in this case I chose the latter.

If this standardization on this kind of abstraction weren’t a priority, this would indeed be a pretty inefficient way of doing this. In fact, I arrived at my current setup by doing what you suggested—setting up a server without containers, building sites directly on it, and serving them from a single reverse proxy instance—and the amount of automation I found myself writing was a bit tedious. The final nail in the coffin for that approach was realizing I’d have to solve web apps with multiple processes in some other way regardless.

divbzero · 16 hours ago
> I explicitly wanted to stay in the Coolify world.

I too was skeptical of the motivation until reading this. Given that Coolify requirement, your solution (build static files in one container, deploy with Caddy in another) seems quite sensible.

Deleted Comment

divbzero commented on Crimes with Python's Pattern Matching (2022)   hillelwayne.com/post/pyth... · Posted by u/agluszak
btown · 3 days ago
My favorite Python "crime" is that a class that defines __rrshift__, instantiated and used as a right-hand-side, lets you have a pipe operator, regardless of the left-hand-side (as long as it doesn't define __rshift__).

It's reasonably type-safe, and there's no need to "close" your chain - every outputted value as you write the chain can have a primitive type.

    x = Model.objects.all() >> by_pk >> call(dict.values) >> to_list >> get('name') >> _map(str.title) >> log_debug >> to_json
It shines in notebooks and live coding, where you might want to type stream-of-thought in the same order of operations that you want to take place. Need to log where something might be going wrong? Tee it like you're on a command line!

Idiomatic? Absolutely not. Something to push to production? Not unless you like being stabbed with pitchforks. Actually useful for prototyping? 1000%.

divbzero · 3 days ago
I suppose you could use the same trick with __ror__ and | (as long as the left-hand side doesn’t define __or__).

  x = Model.objects.all() | by_pk | call(dict.values) | to_list | get('name') | _map(str.title) | log_debug | to_json

divbzero commented on Code formatting comes to uv experimentally   pydevtools.com/blog/uv-fo... · Posted by u/tanelpoder
charliermarsh · 3 days ago
Yeah, you can definitely use `uvx ruff` (an alias for `uv tool run ruff`) to invoke Ruff. That's what I've done in my own projects historically.

The goal here is to see if users like a more streamlined experience with an opinionated default, like you have in Rust or Go: install uv, use `uv init` to create a project, use `uv run` to run your code, `uv format` to format it, etc. Maybe they won't like it! TBD.

(Ruff is installed when you invoke `uv format`, rather than bundled with the uv binary, so if you never use `uv format`, there aren't any material downsides to the experiment.)

divbzero · 3 days ago
> (Ruff is installed when you invoke `uv format`, rather than bundled with the uv binary, so if you never use `uv format`, there aren't any material downsides to the experiment.)

That’s thoughtful design and could be worth mentioning in the blog post.

divbzero commented on Derivatives, Gradients, Jacobians and Hessians   blog.demofox.org/2025/08/... · Posted by u/ibobev
divbzero · 7 days ago
Would love to see div and curl added to this post.
divbzero commented on PYX: The next step in Python packaging   astral.sh/blog/introducin... · Posted by u/the_mitsuhiko
zanie · 11 days ago
Thanks for the feedback!
divbzero · 10 days ago
The combination of

– “client (uv) and server (pyx)” and

– “You can use it to host your own internal packages, or as an accelerated, configurable frontend to public sources like PyPI and the PyTorch index.”

is what really helped me understand what pyx aims to be.

divbzero commented on PYX: The next step in Python packaging   astral.sh/blog/introducin... · Posted by u/the_mitsuhiko
integralid · 10 days ago
What's wrong with just using virtualenv. I never used anything else, and I never felt the need to. Maybe it's not as shipping l shiny as the other tools, but it just works.
divbzero · 10 days ago
There’s nothing wrong with just using virtualenv. I too have used virtualenv plus pip (and sometimes pyenv) for the longest time without issue.

However, uv is the first alternative that has tempted me to switch. uv offers performance improvements over pip and handles pyenv use cases as well. I’ll be paying attention to pyx to see how it pans out.

Deleted Comment

divbzero commented on Galileo’s telescopes: Seeing is believing (2010)   historytoday.com/archive/... · Posted by u/hhs
Daub · 11 days ago
An appropriate time to post a photo of a replica Galileo telescope made by my late father.

https://www.dropbox.com/scl/fi/2cc84vlxe9q8v6ppp6st9/tel.jpg...

And bonus, a replica he made of van Leeuwenhoek's microscope:

https://www.dropbox.com/scl/fi/gwdb2r71d49pf8m4a5243/micro.j...

divbzero · 11 days ago
This is incredible. Did he ever describe how he made the replicas? How did he know what the originals looked like?
divbzero commented on Galileo’s telescopes: Seeing is believing (2010)   historytoday.com/archive/... · Posted by u/hhs
divbzero · 11 days ago
A few years ago I pointed out Jupiter in the night sky as I was leaving a friend’s place. He told me to take a closer look with his binoculars and I was stunned: The Galilean moons were unmistakable. I had no idea they could be seen with a simple set of modern binoculars.

u/divbzero

KarmaCake day9965October 8, 2017
About
Hello, world.

  #!/bin/bash
  name=chris
  user=divbzero
  email=${name}@${user}.com
  code=https://github.com/${user}
  website=https://${user}.com
[ my public key: https://keybase.io/divbzero; my proof: https://keybase.io/divbzero/sigs/o74zfvmaYGlCRV0hSUGRNdI1y03rbNP65tL072qROtg ]

[ my kismet code: ef956b ]

View Original