Hello. I was wondering how to divide Django and Django Rest projects into apps? I mean suppose I am creating an E-Commerce API in Django Rest Framework. In that I will have a core app that will handle user authentication, a products app for adding, deleting, modifying and managing products. Then I have a Seller app that will handle sellers, they can add the products they want to sell etc. then separate apps for reviews, ordering and even for a cart app. For order I will have payments integrated into the app. The cart will be unique to each user (one user with one cart only).
Now, this is a toy project, I understand that it is good to divide an API into apps. Now sure, this is just a toy example and the actual softwares can be much more feature rich, can contain so many modules and have such a large codebase. But do they create apps at such granular levels? That will create so many apps, won’t it?
All in all, I just wanted to ask (especially for such a small scale project) when is creating an app actually essential and when is it just an overkill (and possibly over-engineering)?
No, it is not always a good idea.
This is a topic that has been discussed multiple times previously.
For starters, see:
- Why do we need apps?
- Project organization- when is something a separate app?
- I need help with what should be an app and what shouldn't
- Structuring external service integrations in Django
(There are others, but most threads end up at some point referencing one of these.)
My opinion on this is at: Structuring external service integrations in Django - #2 by KenWhitesell