(One of my summaries of the one-day Pycon NL conference in Utrecht, NL).
In 2024, what is a fullstack python dev? Well, python. Database administrator. Integrator with external services. A bit of terraform or kubernetes. AWS clicky-clicky expert. And a bit of frontend.
So the frontend is only a small part of your job. You have a package.json
that makes
no sense to you, so you just npm install
it and download the entire internet into
your local node_modules/
folder. But somehow it seems to work.
The frontend? You have frameworks. More frameworks. Meta-frameworks that framework your frameworks. Frameworks don’t make things simpler, they just move the complexity somewhere else. If you use django’s ORM, you don’t have to deal with the complexity of SQL. But in exchange you have to learn the django ORM.
He wants to look at three layers:
Markup / html.
Styling / css / design systems.
Interactivity / javascript.
Markup and html. On one hand you can have bindings. “Fasthtml”, for instance. A
mapping from python to html. return Div(H1("hurray"))
. You just move the complexity.
Or “native web components”. You have custom <star-rating>
elements that get
translated into actual html. You need specific javascript code for this, so it isn’t
really portable between frameworks.
Another alternative: templating. Jinja2
is used in most programming languages. You
can do some templating, but it quickly gets unreadable.
All these solutions are great in their own way, but also suck in their own way.
Styling/css. This is an area that actually saw a lot of improvements in the last years! CSS now supports variables out of the box, so no need for “sass” or so anymore.
You used to use bootstrap, jquery and a few other things and try to style your divs and
spans. You don’t need to do that anymore: there is more than just span and div
nowadays. Classless: you use html’s new elements such as <article>
and get
something not-too-bad out of the box. You don’t use custom class statemens anymore.
CSS has its own utility frameworks now, like tailwind. He dislikes tailwind (just use a style on your element…). For the rest, css seems in pretty good shape.
Interactivity/javascript. Javascript used to be essential for things like hovers and tooltips. But: that’s build into html/css now! No need for javascript for this.
You could look at web assembly. https://pyscript.net/ for running python in the browser. Nice. But you need to know both the internal browser API and the webassembly bindings and get python to run… He looks at this field about once every half year to see if it is ready for normal use.
HTMX could be nice. https://htmx.org/ . Interactivity for your html page with auto-replacing of certain parts of the page without you needing to do javascript. It is pretty popular, but he found lots of the functionality pretty hard to use. After two years, he found out he used only one part of it most of the time. So he wrote some small javascript thingy to do just one simple kind of replacement.
Interactivity: most of it sucks.
Summary: there is no one silver bullet for your project. In many cases you’re going to benefit from building something yourself. So: if there’s no silver bullet, just produce a lot of regular bullets. Small custom self-made one-offs.
My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.
Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):