Juro Oravec's Avatar

Juro Oravec

@jurooravec.bsky.social

Freelancer, Open-sourcerer. Bringing Vue DevExp to Django - django-components, django-vue, alpinui (port of Vuetify) - https://github.com/JuroOravec - https://linkedin.com/in/jurooravec/

16 Followers  |  21 Following  |  32 Posts  |  Joined: 02.11.2024  |  2.1268

Latest posts by jurooravec.bsky.social on Bluesky

Preview
Use django-components as a vehicle to introduce new features into Django's templating Β· Issue #91 Β· django/new-features Code of Conduct I agree to follow Django's Code of Conduct Package Information django-components (https://github.com/django-components/django-components) Problem TL;DR Use django-components as a ve...

1.5 year ago I joined Emil on django-components as I was frustrated with Django.
Now the project is much further and we're starting the discussion on how it could be merged to Django.
Please share your thoughts or concerns!
Getting django-components to Django 6.1 or 6.2 would be lit af.

30.10.2025 22:22 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Asking Chatty how to make black tea faster and it whips up pandas. πŸ‘Œ

10.05.2025 07:29 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

In the end, the cleanest way is to forgo the bells and whistles, and require users to add the static types themselves.

15.04.2025 13:34 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image Post image

Next I tried code generation with overloads. Similar to how Prisma works - A command generates the static types, inserts it into package (site-packages), and Mypy picks it up. After some trial and error I got it working. But... Mypy was always picking the first overload...

15.04.2025 13:34 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image Post image

I had a good mileage with Generics. But subclassing classes with generics is crazy verbose - You have to re-define all generics, and use the `default` field as the values you actually want.

15.04.2025 13:34 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Well this is... something. Python, 2025. The best way for statically typing methods on subclasses? Generics? No. Overloads? No. Codegen? No. Instead? Give up and do it manually.

15.04.2025 13:34 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Can you recommend some tutorials with advanced setup for vibe coding / AI code assistants? I wanna know if my codebase is just too complex or I'm falling behind

10.04.2025 06:52 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@pypi.org Down?

08.04.2025 09:09 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
djc-heroicons Icons from HeroIcons.com for django-components

Just published djc-heroicons - this is the first package with shareable components for django-components. So kind of a HelloWorld :)

pypi.org/project/djc-...

08.01.2025 21:02 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

This weekend I've build 2 packages for django-components
- One for icons from HeroIcons.com
- The other for "ErrorBoundary" component

Still blocked by a few more PRs on django-components, but will ship it as soon as possible.

05.01.2025 17:53 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image Post image

Hand-in-hand with the TagSpec, I also wrote a parser that takes Django template tag's input (the string between {% %} ), and sorts and parsers it into args, kwargs, flags, etc.

The parser converts the tag's input into AST that describes each arg / kwarg / flag, and even each filter separately

17.12.2024 21:08 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

The tag spec makes it possible to programmatically manipulate with the Django template tag's definition - I used for the docs for django-components to automatically generate the template tag signature from the spec.

17.12.2024 21:08 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

For django-components I wrote a utility for defining and parsing Django template tags - You define the spec ("TagSpec") with args, kwargs, and flags (and more) that the template tag uses. And the utility does the parsing for you.

Should I make it into a standalone package?

17.12.2024 21:08 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

6/5 Create a mid-sized demo project that showcases how to use django-components

16.12.2024 13:57 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Recently we got startups and SMEs asking about django-components. Is there any unknowns? What's something that makes the decision / comparison either difficult or ambiguous? What can we improve?

16.12.2024 11:18 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 1

This has been irking me too. My thoughts were to replace the ORM with prisma python client, but ofc that doesn't play well with current Django

15.12.2024 18:48 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
django-components/src/django_components/templatetags/component_tags.py at 6813c9d7aa4acfb04df9665651a2864d04bbe8ba Β· EmilStenstrom/django-components Create simple reusable template components in Django. - EmilStenstrom/django-components

See I did that in django-components. Would it make sense to make that code into a standalone package?

github.com/EmilStenstro...

15.12.2024 18:44 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

So if I was writing such LSP, the for custom template tags, I would ask users to define their template tags as these "TagSpecs", so the LSP would know how to handle their custom tags. And for built-in Django tags, the LSP would have their "specs" hard-coded.

15.12.2024 18:44 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

For Django-components I wrote code for declaring template tag API - so one defines upfront which args, kwargs, and flags the template tag may take. And the parser uses this "spec" to know how to parse the template tag inputs. This way the template tag API is codified, e.g. to the generate docs.

15.12.2024 18:44 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

For built-in tags, this is not an issue - you can use Django's documentation and hard-code that into the LSP. But for custom template tags, I can't imagine how you could use vanilla Django template tags with LSP for e.g. autocompletion.

15.12.2024 18:44 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

One issue I expect is that Django doesn't define the API of the template tags very well. It just splits up the string inside {% %}, and leaves the rest up to the user. User could use Django to parse the template tag inputs as args and kwargs, but they might not.

15.12.2024 18:44 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Do I imagine right, that the user would define the path to the Django settings file, and then your spawned process would use that to set up Django? And that's how you could then figure out which template tags are available?

15.12.2024 18:44 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Love that! Lack of LSP for Django's been irking me too. In the end what I wanna try is to allow to write Vue files directly for Django. Because I want to write JS-heavy components, and Vue already has tooling for that. I would still need to fork their code to allow for extra python section.

15.12.2024 18:19 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I'm thinking of the same for django-vue. Barely working, but getting the idea out there sounds worth it. IMO do it!

15.12.2024 18:13 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Thoughts on Django features Django Topics Taken from https://docs.djangoproject.com/en/5.1/topics/ How to install Django Install Python Install Apache and mod_wsgi Get your database running Install the Django code Models and dat...

Best of luck! My there's a lot of room for improvement. I was thinking about that too, with FastAPI as the server, and Prisma as the ORM. Have a look here for more ideas:

docs.google.com/document/d/1...

13.12.2024 12:00 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Is this LSP for Django templates, or specifically django-bird? How do you define known tags? Would there be a way to add project-specific template tags?

I wrote a parser in Python that detects both HTML and Django syntax, you can use that if you want.

13.12.2024 11:50 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
Replace BeautifulSoup4 with own lightweight HTML parser Β· Issue #831 Β· EmilStenstrom/django-components Currently we depend on BeautifulSoup4 to parse and modify the HTML to enable features like scoped CSS, JS / CSS vars, etc. As mentioned in #823, ideally we wouldn't have to depend on external packa...

5/5 If you want a bite-sized thing, you can help us write an HTML parser (~1 week)

github.com/EmilStenstro...

13.12.2024 10:19 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
Improving time to load. Inspiration from McMaster-Carr Β· Issue #835 Β· EmilStenstrom/django-components This is based on the discussion in #717. I think it would be great to eventually implement these, so I'm making an issue for this, so we can track progress for this. Original video: https://youtu.b...

4/5 Or you could help us make Django apps fast by implementing various optimisations (~2-3 weeks)

github.com/EmilStenstro...

13.12.2024 10:19 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Tetra - Full stack reactive component framework for Django using Alpine.js

3/5 Help migrate Tetra to use django-components instead of their own implementation. This is the "LiveWire" part of the "Vue + LiveWire". (~3-6 weeks)

tetraframework.com

13.12.2024 10:19 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
UI component library Β· EmilStenstrom django-components Β· Discussion #547 Intro This thread is meant to be the main place for discussing building component library / design system on top of Django + django-components (DC). When I refer to (UI) component library or a desi...

2/5 Build a UI component library that's first of it's kind (in terms of sophistication) for Django ecosystem. The library is a port of Vuetify. What remains is to convert ~100 JSX files to Django templates. This would be huge for everyone using Django for UI (~1-2 months)

github.com/EmilStenstro...

13.12.2024 10:19 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

@jurooravec is following 19 prominent accounts