by patates · 5y ago · 0 comments
At first, everything seemed super easy, but later I hit so many road-blocks that I had to give up (For example defining a self-referential m2m relationship with a custom join table, and getting it working on the admin site).
Don't people really have such problems with it? It really feels like a huge burden when you do things outside the happy-path. Also the documentation is indeed superb but you also hit a lot of outdated info when searching the web.
Then there's InlineModelAdmin that allows you to integrate your relationships in the admin.
You gave up instead of reading the docs.
Only frustration I have is the power/possibilities of mysql (which I use 99% of the time for various reasons) versus postgre. The latter seems far better and advanced, and it does reflect in the ORM.
But wait, this isn't linked to django, is it? :-)
The one thing I really wish Django had after all these years is multi-column PK support. I bring it up every time I see a thread about Django, hoping the devs or an open-source contributor will take it on. But after 10+ years, the open ticket just keeps passed on and I don't know that I have the skills to do it myself.
You do need to have the documentation handy, and writing efficient queries can be tricky, but it is the ORM that makes the most sense to me, and the easiest to get started with.
For instance, in my experience the admin site is best thought of as glorified DB UI. If you need something more than what it can offer out of the box, you should switch to coding it yourself, or live with a quick hack.
I think that most of the time, Django just gets out of the way. At least if you stay away from the inheritance spaghetti that is class-based views. Use the functions, Luke. :)
Agreed. My biggest Django headaches ultimately resulted from me trying to make the admin console do more than it's meant to do.
Sure, you easily get into a situation where you're out of luck using the admin module, but there are also entire classes of problems that can be solved using only the build in admin functionality.
With Django as soon as I have anything to do with a database I seem to hit this with the ORM. So I start working around it. Next thing you know it all seems to fall apart because of how coupled the rest of the application is to Django's assumptions about views and entities in the DB.
So "You gave up instead of reading the docs.": I go back to flask, or recently FastApi where you have to figure your schemas and access patterns out for yourself in advance instead of building thorough and deep knowledge on how to deactivate parts of Django when they become redundant. Opinion my own, results may vary, IANA your dev, etc
That being said, weighing up the good with the bad, its still my favourite web framework
It obviously depends very much on your opinion on what defines "heavy processing", but we do all those things without too much trouble. Obviously we may, and probably do, do things differently to you (we dont use Angular for example, though that seems like it wouldnt be too big a factor) so YMMV, but yeh, for us its been pretty solid
I did follow the docs, it gave errors for one reason after another, and I don't have the time to dive into Django internals anymore when stuff like that keeps happening. From there came my opinion that non-happy path is not very much supported.
Django Admin is not really designed to be an all-encompassing admin solution I've found, it's a good start but normally you design your own admin console anyway using your API so I've not cared that much about those shortcomings.
I never got the chance to use it professionally so I didn’t get the “fully under control” feeling I get when working with .NET, thus never had the confidence to push for it in my company/clients out of fear of not being able to fix whatever went wrong.
Kind of regretting not making the switch back then, but well, nowadays .NET is good enough. Never managed to squeeze as much productivity as I did with those small college projects back then.
If you have a data model that requires a self-referential m2m relationship, think if there is another way to model it ("collection" object), or don't tell Django about it.
With Entity Framework and Dapper, I don't think I can be more productive at the back-end in any other stack than I'm with .NET. If I have a couple of models, I'm usually done with basic CRUD, including REST controllers under an hour.
For the front-end, I wrote a couple of purpose-built generators for now.