Live data from Hacker News

Happy 20th Birthday, Django

djangoproject.com

61–70 of 191 posts

Re: Happy 20th Birthday, Django

#61
post #40
post #8

Not to conflate a framework and a language, but there’s something about Django that makes me feel like I’m writing PHP. What is this effect?

When Adrian and I first designed Django we were PHP developers switching to Python, so quite a few Django pieces were inspired by PHP. Django's request.GET and request.POST were directly influenced by $_GET and $_POST. Django's template language included ideas from the Smarty PHP template language.

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 :)

Re: Happy 20th Birthday, Django

#62
post #61
post #40

Earlier quoted context omitted.

When Adrian and I first designed Django we were PHP developers switching to Python, so quite a few Django pieces were inspired by PHP. Django's request.GET and request.POST were directly influenced by $_GET and $_POST. Django's template language included ideas from the Smarty PHP template language.

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.

Re: Happy 20th Birthday, Django

#64
post #11
post #8

Not to conflate a framework and a language, but there’s something about Django that makes me feel like I’m writing PHP. What is this effect?

Laravel keeps copying Django (I mean it in a good way)

Laravel’s ORM was originally inspired by my now-long-dead PHP projects Idiorm and Paris:

https://laravelpodcast.com/episodes/c7807d42/transcript (Search for “Paris” to find the relevant section)

https://github.com/j4mie/idiorm

https://github.com/j4mie/paris

Idiorm was started in early 2010 while I was still writing PHP professionally. I’d heard about Django from a talk @simonw gave at the FlashBrighton meet-up group in 2009 and immediately fell in love. Idiorm and Paris, although not direct attempts to duplicate Django’s ORM, came from frustration that such an elegant ORM and query builder didn’t exist in the PHP world.

So in a roundabout way, Laravel’s ORM was absolutely inspired by Django.

As a side note, I’m still doing Django 16 years later and love it more than ever.

Re: Happy 20th Birthday, Django

#65
post #12

Fastapi has completely replaced django for me. I do not miss orm at all.

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)?

Re: Happy 20th Birthday, Django

#66
Love django. Whats the consensus on best way to use django in 2025? I've been going the headless route. Django for the backend and using vite or nextjs on the frontend with openapi specs auto-generated.

Re: Happy 20th Birthday, Django

#67
post #11
post #8

Not to conflate a framework and a language, but there’s something about Django that makes me feel like I’m writing PHP. What is this effect?

Laravel keeps copying Django (I mean it in a good way)

Laravel borrowed much from Rails, Django and others. But unlike them actually moved forward.

Re: Happy 20th Birthday, Django

#68

Fastapi has completely replaced django for me. I do not miss orm at all.

"If you're not using Django, you're probably just rebuilding it poorly."

I think FastAPI's one major design difference is its dependency injection mechanism. Django is designed to do things differently, with services provided through an app- or project-global collection of middlewares (although I haven't used it in a while, maybe something had changed since then) and while there are DI solutions for Django they don't feel "native" to me - not the way FastAPI does it. Either way works, of course - it's probably merely a matter of the preferred mental model.

Re: Happy 20th Birthday, Django

#69
Django is somehow the one thing in Python I never enjoyed working on. I recommend it thoroughly to people running teams since it keeps devs disciplined, but I've always been a Flask programmer at heart. To each their own. I'm glad Django exists, it's eaten plenty a share of the pie that would have otherwise gone to Rails maybe.

Re: Happy 20th Birthday, Django

#70
post #51
post #45

Earlier quoted context omitted.

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

I don't think you can honestly and objectively criticise something you don't truly know. There's still no framework in e.g. Go that comes anywhere close to matching Django. It's pragmatic, doesn't do too much meta-magic (I still don't "get" Rails), lets you strip away any layers you don't need, etc.

I think Phoenix is very close to Django at fitting that bill.
Post reply on HN