Live data from Hacker News

Unicorn – A full-stack web framework for Django

django-unicorn.com

1–10 of 92 posts

Re: Unicorn – A full-stack web framework for Django

#4
I wondered how Unicorn compared to htmx. They're giving an answer on their website:

htmx and alpine.js are great libraries to provide interactivity to your HTML. Both of those libraries are generalized front-end framework that you could use with any server-side framework (or just regular HTML). They are both well-supported, battle-tested, and answers to how they work are probably Google-able (or on Stackoverflow).

Unicorn isn’t in the same league as either htmx or alpine.js. But, the benefit of Unicorn is that it is tightly integrated with Django and it should “feel” like an extension of the core Django experience. For example:

* redirecting from an action uses the Django redirect shortcut

* validation uses Django forms

* Django Models are tightly integrated

* Django messages “just work” the way you would expect them to

* you won’t have to create extra URLs/views for AJAX calls to send back HTML because Unicorn handles all of that for you

Re: Unicorn – A full-stack web framework for Django

#5

Does class TodoView(UnicornView): create a model? class UnicornView(TemplateView) and from django.views.generic.base import TemplateView Is this Django magic a Flasker doesn't get?

As far as I understand UnicornView attributes (such as `self.tasks`) simply synchronise client state with the server side. It doesn't seem to automagically create a model instance unless you specifically do it.

Re: Unicorn – A full-stack web framework for Django

#6
post #5

Does class TodoView(UnicornView): create a model? class UnicornView(TemplateView) and from django.views.generic.base import TemplateView Is this Django magic a Flasker doesn't get?

As far as I understand UnicornView attributes (such as `self.tasks`) simply synchronise client state with the server side. It doesn't seem to automagically create a model instance unless you specifically do it.

This is correct. It looks like there is good integration with existing Django models: https://www.django-unicorn.com/docs/django-models/
Post reply on HN