[HN Gopher] Django: what's new in 6.0
       ___________________________________________________________________
        
       Django: what's new in 6.0
        
       Author : rbanffy
       Score  : 83 points
       Date   : 2025-12-09 20:33 UTC (2 hours ago)
        
 (HTM) web link (adamj.eu)
 (TXT) w3m dump (adamj.eu)
        
       | giancarlostoro wrote:
       | Template partials look good, which is one of the key reasons
       | frameworks like React are as good and popular as they are,
       | because you can reuse small segments of code.
        
         | squidsoup wrote:
         | React allows for encapsulation of state in a reusable
         | component, its more than just templating.
        
         | agumonkey wrote:
         | indeed the vintage templating was a logical bottleneck
        
           | f311a wrote:
           | How is it different from include? Just less files from my
           | perspective
        
             | simonw wrote:
             | The "inline partials" feature is neat, means you can use
             | and define a partial at the same time.
             | 
             | The way you can render just a named partial from both the
             | render() shortcut and the include tag is nice too:
             | 
             | https://docs.djangoproject.com/en/6.0/ref/templates/languag
             | e...
        
               | f311a wrote:
               | Yeah, but I was doing the same thing 10 years ago with
               | include mixed with extends and blocks. I can just include
               | a file inside a template or render it directly.
        
             | chistev wrote:
             | I asked the same question
        
         | simonw wrote:
         | They're a neat design. I started using them on my blog the
         | other day as part of trying out Django 6:
         | https://github.com/simonw/simonwillisonblog/blob/faec3532183...
        
         | chistev wrote:
         | But you could already reuse templates in Django by including
         | them. What am I missing?
        
           | teagee wrote:
           | Check out the HTMX example in the blog, this helped me better
           | understand how it could be used
           | 
           | https://adamj.eu/tech/2025/12/03/django-whats-
           | new-6.0/#rende...
        
             | The_Fox wrote:
             | I'm an avid HTMX user but never did I ever think "I'm using
             | so many includes, I wish I didn't have to use include so
             | much."
             | 
             | What I would like is a way to cut down the sprawl of urls
             | and views.
        
               | adparadox wrote:
               | I do a check for `request.htmx` in my views and
               | conditionally return a template partial as needed. This
               | reduced my need for one-off view functions that were only
               | returning partials for htmx. Works pretty well from my
               | experience.
        
       | teagee wrote:
       | Any code or blog written by Adam is worth spending some time on.
       | 
       | It will be interesting to see how the tasks framework develops
       | and expands. I am sad to see the great Django-Q2 lumped in with
       | the awful Celery though.
        
         | jonatron wrote:
         | I'm of the opinion that django task apps should only support a
         | single backend. For example, django-rq for redis only. There's
         | too many differences in backends to make a good app that can
         | handle multiple. That said, I've only used celery in production
         | before, and I'm willing to change my mind.
        
       | ChrisArchitect wrote:
       | More discussion: https://news.ycombinator.com/item?id=46153116
        
       ___________________________________________________________________
       (page generated 2025-12-09 23:00 UTC)