Live data from Hacker News

Django 3.2

djangoproject.com

41–50 of 195 posts

Re: Django 3.2

#41

Earlier quoted context omitted.

Then why not work with PHP?

There’s nothing wrong with PHP. And Laravel is very popular for good reasons. There are people out there writing Python just as bad as what you think of as bad PHP. One dev I knew insisted everything must be a list comprehension — including all for loops in regular flow control. That was Not Good(tm). ——— Edit: please read the parent comments for context. GP said there’s no right or wrong and OP said then why not use…

I generally agree philosophically but PHP has a couple of features which make problems more likely: the C style error handling increases the odds of problems being ignored (yes, Python can have except:pass but that’s more obvious & requires intent) and the mushy typing hits even experienced developers who didn’t think about whether they needed === instead of ==. The standard library’s inconsistent parameter ordering for related functions probably deserves a mention here, too.

I started using PHP around 1998 and quit cold-turkey about a decade later for Python after noticing across the board quality improvements on every project. PHP isn’t terrible but using it requires constant diligence and few teams had the extra time and skills to use it safely.

Re: Django 3.2

#42

Before Django the gold standard for Python web apps was Zope. What a tremendous achievement by the Django team!

I remember Zope was pretty universally disliked by Python programmers. But it was for a time probably the most enterprisey thing with Python inside, so maybe it got more points in corporate places as something to try as an alternative to Enterprise Java Buzzwords.

Before Django there was a lot of choice and active libraries / frameworks for Python web app development, IME most apps gravitated more towards "ala carte" use of libraries than one size fits all frameworks, a bit like people do in Clojure today.

Zope was more like a ready to use CMS that incidentally enabled you to mod it using Python in a clunky way.

The object database part of Zope (ZODB) was pretty cool though, used separately (inside Zope the framework-enforced object schema made it just clunky). As long as you didn't let it spread too wide over your codebase. But it had transactions, flexibility of (and problems of...) schemaless, and replication, a long time before the "NoSQL" craze.

Re: Django 3.2

#43

Earlier quoted context omitted.

Zope? Now, that's a name I haven't heard in a long time... A long time. I wonder of this magnificent monstrosity is still alive?

It’s still alive and underpins the CMS plone [1]. It has evolved and separated into zope [2] zodb [3] and ztk. [1] https://plone.org [2] https://zope.org [3] https://zodb.org Note: circled the link.

I remember being quite interested in zodb for app development in python since it alleviates the need for an orm... it is a bit like a document store, right?

Re: Django 3.2

#44

Congratulations to the Django project and contributors on a big LTS release. And a huge thank you for the consistently excellent framework that so many have built their web dev careers on. I'll post this as a Show HN soon, but I'll mention it now as a soft-launch introduction. After a decade of using Django I started a project I always wanted to exist: backported security and bug fixes to old versions that the Django…

This is a great idea...unfortunately a company that skips on Django security patches and bug fixes will very likely be doing the same for everything else (frontend libraries, servers, etc). But there's not much you can do when you're stuck on a feature-factory treadmill, and this looks like a cost-effective way to ameliorate the problem.

Re: Django 3.2

#45
Django is so refreshing when you come from JS world. Combined with Python is such a pleasure to do stuff with it. My favourite model is Django backend and React frontend though (I try to keep it as lean as possible). Congrats! Looking forward to update my projects.

Re: Django 3.2

#46
post #38

Earlier quoted context omitted.

You should try it, it’s really all batteries included.

The ORM is horrendous.

Can you elaborate? I've been using it for years and it mostly does what I want. It's an ORM and obviously sometimes generates unefficient queries I need to manually amend/refactor but otherwise I don't see any major issues with it?

In contrast I've looked at SQLAlchemy with Flask and I couldn't even wrap my head around declaring models (which inherit from the DB connection object if I remember correctly, so potential for circular imports) and manually managing transactions/sessions seems unnecessarily complex.

Re: Django 3.2

#48
post #16

Earlier quoted context omitted.

I owe a lot to Django as it was really the thing that got me into backend programming by leading me to learn python in early 1.X days. My first real programming job was backend django programming for a newspaper. Eventually things shifted towards django-rest-framework, flask, and now my go-to Starlette. Haven't used Django in some time but really appreciate the project and happy to see it moving along.

Same here. Django 0.96 at the Washington Post. I start a new job next week at a Django shop after a couple years of JS and Go. I look forward to getting back to it but I will miss Go. :)

Congrats on the new job! I never really dabbled with Go, but a team I was on recently worked with a backend written in Go, and I was present in lots of discussions :) For current project I'm using Starlette/asgi, but I'm sure Go would have some advantages

Re: Django 3.2

#49
post #2

I have been using version 3.2 since Beta. Deployed on a production application, so far without a single problem. I highly praise Automatic AppConfig discovery and BigAutoField for pkey. I highly recommend the transition to Django 3.2 Full release notes: https://docs.djangoproject.com/en/3.2/releases/3.2/

The ability to customize the type of auto-created primary keys is also one step towards fixing one of the long-standing issues in Django: https://code.djangoproject.com/ticket/56

Re: Django 3.2

#50
post #12

I'm more if a flask man myself. Worked with django only when I had to. Maybe I'm wrong?

Depends what you want to do, and why you're doing it. Very often when I make something in Flask, I end up with so many dependencies it might as well be Django (but without the cohesion). On the other hand, Django might be overkill in some situations (e.g. a small API without a relational database backend).

Django has a substantial learning curve and you may need to spend more time to get started. But ultimately to do the same thing in Flask you have to spend comparable time to learn, except that Flask lets you start much quicker into your learning. As your Flask project grows you find out it is not actually that easy nor convenient. This is of course my experience only. I decided to just stick to Django (and DRF) and I feel no need to use anything else. For performant services I use Go.
Post reply on HN