I honestly can't think of a single other piece of software that has actively saved me as much time.
Very much this. I tend to lean towards Flask for building simple APIs. I think it's easier and faster to start a project and get something done.
But I always end up missing the admin features and the far superior ORM, and always regret midway that I did not use Django instead.
Absolutely. Take the extra minute to add a natural key to your Django models and now you can do amazing things like dumpdata from your Prod or Staging database and then loaddata into your local sqlite database for dev. I've never had to run Postgres on my laptop for developing. As long as your CI tests use your production database server type then you don't have to worry about subtle differences between developing locally with sqlite and deploying on another RDMS.
Also Django abstracts the differences away well enough that we've never noticed meaningful differences that aren't already well documented.
But for 99% of the business logic tests I write, sqlite is fine. Sure you might have an issue with Oracle, but for day to day stuff, sqlite is good enough.
If you'd want atomic transactions for the whole Django project, you could just set the ATOMIC_REQUESTS flag in the settings.
Isn't that a potential positive?
I mean, yeah, and those darn programmers with their 'platform independent languages'. Why are you not using the power of assembly?
A better analogy than the language one: Your web app has to run on Firefox, Chrome, and... IE6 yay! You're not allowed to use any modern Javascript, or most of the API's you'd like to use.
Because being able to switch to IE6 at any point in development is more useful than any of those fancy-dancy API's, right?
If there was an ORM that dealt with everything but a flaky end of life database, sure start working on it.
But this is advocating picking one platform. Like creating Chrome-only JavaScript. I guess the nearest thing with Electron.
Yeah the analogies breakdown at some point.
I don't think anything is black-and-white. I just think the vast majority of Django apps are fine with Django's ORM. This article smacked of premature optimisation.
Because if you do learn some SQL, then the problems with ORMs become annoyingly apparent.
I agree that most Django coders will be fine with the ORM. I guess I don't see that as a good thing, though.
I suspect that's the problem. It's neither my feeling or my experience.
Every platform/language/OS/chip I know has annoyingly apparent problems. In my experience high-self-conidence-low-self-awareness folks are too keen to drop-level and 'make it right'. And love feeling how smart they are ('everyone who disagrees is obviously not as smart!) Too often 'smart-guys' cost more, long term. And I'm not ragging on you. That was me in my 20s. Embarrassingly.
Do you normally respond to issues by trying to characterise people?
Imagine this fictional world where anyone that disagrees with me is incompetent.
In my experience, I think working with database specific functionality is like dropping to lower-level of code generally. Something I have done in ORM->Raw SQL and C->Assembly. There is a point where the price in development cost, testing development time, platform lock-in, reduced code reuse IP, subset of experienced programmers within the team/salaries/training, loss of access to future updates and bug fixes, and so on is worth it. But almost never in my experience. Almost but not entirely.
> many junior developers who don't know SQL
Are you really a web developer if you don't even know SQL? Sounds more like an apprentice. You wouldn't call yourself a junior Japanese translator if you didn't speak Japanese. SQL is a basic competency, not an advanced specialist skill.
I've been a web developer for quite a few years now. Mostly front end but I do use Django as well.
I also do know some SQL so I guess I pass your arbitrary test. However, I can count the number of times I've used SQL in the last five years on one hand, and in each case it was something simple like create a role/database, and I had to Google the commands anyway due to a lack of practice.
Not really. It isn't right that the software industry use the same title for both an untrained dabbler and for a CS graduate with a year of industry experience. The former is not a developer, they're a student, or an apprentice. The latter has several years of relevant formal education but only a little industry experience.
'Traditional' engineering fields have legally protected terms like Chartered Engineer. I'm not suggesting software development need be that rigid, but I don't think it makes sense to be so inclusive with a title like 'developer' that it tells the reader almost nothing about the person's level of competence.
Legally protected terms aren't necessary for this. If you call yourself a junior Japanese translator but you don't speak Japanese, you'll be laughed out of the room by real translators. That's as it should be.
> I had to Google the commands anyway due to a lack of practice
But your understanding of the underlying concepts (i.e. the relational model) was still there, and that's no small thing. Familiarity with syntax isn't really the point.
If you're doing any kind of backend work, you need to know how your persistence layer works. You don't need to be an expert, but you need to realize the implications of what you're doing with the ORM. You need to be able to diagnose issues with your database.
There is a grey area between 'don't know' and 'expert'. and what the if someone says it's bad that jr devs don't know something, it doesn't mean they need to be an expert.
That said, what does "web developer" mean relative to those?
This is more "how to replace your car's stock transmission and cluch for dubious benefits and higher costs"
Django works fine out of the box. The example of "needless migrations" are corner cases more than anything and it's fine to have them. It works. They might be useless but if they're correct in the end, that's fine. DB migration is the one of the last places where I will look for performance over risking correctness.
And if you really need performance in one specific complex query, Django lets you do raw SQL queries just fine. Number of times I saw this being actually needed (in a big project): One.
SQLAlchemy on the other hand makes it very easy to do exactly what you need, without even having to drop to writing raw SQL. The way the ORM and the core are structured is the perfect balance of abstraction and control.
Especially when working on a team with many junior developers who don't know SQL (myself included in the early days), the Django ORM has been a shining beacon of reliability and consistency allowing us to do complex database schema changes without ever having to worry about messing them up or not being able to revert our changes.
I don't think I can say the same for any other ORM I've worked with, in particular I have really bad memories of trying to match Django's migration reliability and flexibility using SQLAlchemy + Alembic.
Also in regards to switching databases, the ability to swap out PostgreSQL for SQLite on smaller projects without having anything break is a feature I've relied on several times, and I'm extremely grateful maintaining that clean break in the layers of abstraction was prioritized by the Django team.
Obviously the author of this article has had different experiences (and has considerable authority in this field), but I caution that their experiences are not universal among Python devs.