Live data from Hacker News

Happy 20th Birthday, Django

djangoproject.com

141–150 of 191 posts

Re: Happy 20th Birthday, Django

#141
post #12

Earlier quoted context omitted.

I’ve also switched away from Django (to Litestar), but the ORM is the mean thing I keep missing from Django. SQLAlchemy feels really clunky by comparison

What made you choose Litestar over fastapi (which seems to be the most popular choice right now)?

Mostly the better documentation (last I checked FastAPI docs felt more like a series of blog posts than actual docs, but maybe that's improved). I also preferred the community-driven approach of Litestar as opposed to FastAPI's BDFL-type development structure.

I think there were also some technical details I liked better about Litestar where it was more explicit about things while FastAPI was more "opaque magic happening in the background", but to be honest I don't remember all of those.

Re: Happy 20th Birthday, Django

#142

Out of curiosity, for people who have do projects in both Django and Ruby on Rails, which one would you prefer and why? I learned Python more than 10 years ago, but later chose Rails to be my first web framework to learn, as I also wanted to learn more about Ruby, hence the question.

Understand you're going to get a bit of self-selection bias as the people reading the comments for this article are likely to be Django fans.

Re: Happy 20th Birthday, Django

#143
post #90
post #73

Earlier quoted context omitted.

Now Phoenix and Elixir are two technologies I love! But theyre admin offering is lacking. (Which is ok today in modern development and things like pgadmin)

Django Admin is a bit of a trap though ;) it's powerful enough that you can build an entire application with it, custom views and powerful filtering and ACLs and whatnot, it easily gets 80% of your job done with almost nothing but a declarative DSL. But the remaining 20%? Now you've dug yourself a hole with no recourse but a complete rewrite. It's time/money you would've otherwise spent anyway, but that sunken cost f…

Many frameworks have the "admin" sections with very similar drawbacks. It gets you 80% of the way there in 20% of the time, but the remaining 20% is very difficult to get done.

One framework which does not have this problem - or at least minimises the problem, is the Yii framework for PHP. A very nice and underrated framework

Re: Happy 20th Birthday, Django

#144
Happy birthday, Django. I've used, read and loved just about every part of you from the magic-removal days onwards when I had the Rails book on my desk and your docs in my browser, and you (and Python) won. I loved spending thousands of lines in a models.py modelling all sorts of problems before I touched a single line of other code. You got me into open source and then you got me into writing JavaScript seriously via the first large library I ever wrote in it (a port of what was then django.newforms - thanks and vale, Malcolm - for Node.js and the browser). You're my favourite framework I haven't actually used for a decade.

Django's docs can't be praised enough, they've always been the gold standard that I aspire to, taking a similar approach to documenting my own stuff seriously leveled me up, and great docs written for humans by humans stand out even more amongst the painlessly effortlessly generated slop of the day that's painful and effortful to read.

Template inheritance was so elegant and simple compared to the Java and PHP I was professionally and personally using at the time, but 20 years later and after having used Hono, one thing I'd love to see in Django is... JSX in Python! Imagine:

    def Layout(title: str, children):
      return (
        
          
            {title}
          
          
            {title}
            {children}
          
        
      )

    def message_list_view(request):
      messages = ['Good Morning', 'Good Evening', 'Good Night']
      return render(request,
        
          
            {[{message} for message in messages]}
          
        
      )

Re: Happy 20th Birthday, Django

#145
post #60
post #12

Earlier quoted context omitted.

I’ve also switched away from Django (to Litestar), but the ORM is the mean thing I keep missing from Django. SQLAlchemy feels really clunky by comparison

I think the ORM is fine. There's always some friction coming from mapping rows to classes and objects, but you can always drop down a layer and just pull raw tuples. What I'm not a fan of, is the query DSL. Normally, the developer works to figure out how to express their problem with SQL; then the DB engine works to figure out how to map that SQL to the data it has on disk. Now Django adds another layer, which is com…

This is my pain point in Django as well, the query DSL. 10+ years with Django and I still don't know how it's supposed to work, given it's all done within the namespace of a function call.

Fortunately, I now have AI to write any Django queries for me.

Re: Happy 20th Birthday, Django

#146
post #45
post #25

As someone today who is an unrelenting critic of python. I have to say thank you to Simon and the Django community as a whole. Its a wonderful "batteries included" framework that has launched many successful projects, companies, and careers. Mine included. And I'd be lying if I didnt say I still use pgadmin as my benchmark for evaluating admin panels in other ecosystems. What you all created with Django is amazing. W…

How can you be an unrelenting critic of Python but love Django?

> How can you be an unrelenting critic of Python but love Django?

Writing a Django app is like writing Python, but it's more like writing Django.

Re: Happy 20th Birthday, Django

#147

20 years is an eternity in web development, and Django's longevity is a testament to its brilliant design philosophy. Happy birthday to the framework that gets things done. Django is pragmatic, secure, and unbelievably stable. It's the framework you choose when you want to build a real business, not just chase the latest trend. It has powered some of the biggest sites on the web, and it's still the best choice for a…

Wasn't Django inspired from Rails

Re: Happy 20th Birthday, Django

#150
post #62
post #61

Earlier quoted context omitted.

This is surprising because the template language in particular feels so anti-PHP, it’s highly opinionated about not mixing code in with the template. I often wish it supported arbitrary Python. Anyway, thank you Simon :)

Yeah, the template language was strongly influenced by NOT wanting to allow arbitrary logic like PHP does. I was already a fan of Smarty - https://www.smarty.net/ - which did a great job of separating out presentation logic in PHP. I've been using Jinja for my own projects for a few years because I wanted more expressive Python code in my templates! I think we didn't quite get the balance right for that in Django.

I think a great combo would've been Django's features, packaging and most importantly documentation, but with SQLAlchemy and Jinja2 technologies underneath.
Post reply on HN