EDIT: Citry is a frontend framework for Python, a way to write UI / HTML templates, an alternative to eg Django templates or Jinja.
Hi everyone! New major version of django-components is out
The project has been renamed to Citry, and it:
- Works now with Django, FastAPI, or any other web server
- Directly integrates with AlpineJS and makes it easy to pass data from Python to Alpine
- Has integrated server-side event handling and server-side state inspired by livecomponents
- Now has the same quality-of-life features as Vue or React - type-checking, linting, editor integration (hints, autocomplete, reference lookup) - both for Python and Alpine expressions
New website: https://citry.dev
New github: GitHub - citry-dev/citry: Fully typed frontend framework for Python with server events and Alpine.js, inspired by Vue and Livewire. · GitHub
VSCode ext: Citry - Visual Studio Marketplace
To get a feel for the new version, look through:
- Landing page - https://citry.dev
- Getting started pages - Install Citry - Citry
- Live coding video - https://www.youtube.com/watch?v=d3nPqvDdNB0
- Live playground - Try Citry - Citry
- Benchmarks - Benchmarks - Citry
The new Citry library supersedes django-components.
Citry has its own syntax that’s similar to Vue, but remains equal with Django’s. For gradual migration / backwards compatibility, there is citry-django, which allows to mix the Django and Citry syntaxes.
Overall, I recommend migrating from django-components to Citry, that will keep 90% of the code the same, but will also:
- catch errors in templates and Alpine expressions
- reduce boilerplate
- and lots more.
Suggested next steps:
- Have a look through the links above when you have the time
- Let’s schedule a call where I would show you how it works
- Then we can discuss whether to proceed with the migration and how
I’m happy to help with the migration and onboarding.