|
Like I said, you don't need class-based views if you split your code correctly. You have a function, which takes a request and URL parameters, and returns an HTTP response. You add some decorators to require an authenticated user and/or some permissions. That's it. This is no different than flask views. Mixins are an OOP pattern that promotes spaghetti code if not done carefully, especially in Python where there is no encapsulation. ViewSets are from the Django REST Framework, this is simply all the boilerplate code that you copy/paste hundreds of times. And even that, you might not need it if your API is different enough from your database schema. Even more if you don't need an API. There is nothing "magical", every single framework have a happy path, you should follow it if you decide to use this framework. And no, Flask is not a framework, it is a library, much smaller scope, much more boilerplate code that you need to copy/paste, or you build your own framework on top of it. Flask is about the freedom of choice while Django made the decisions for you 10 years ago. Having some experience with Rails, SpringBoot, Phoenix, Symphony, Laravel, Flask, Express, etc... it turns out that I don't want to make those decisions every single time, for every single project. |
Or maybe it's culture non-fit. I'm not used to web dev/django habits.