0
votes

I'm new to Django and trying to understand the preferred means of operation when building an application

Let's say i'm making an e-commerce application that allows sellers to sign up, upload their products etc and allows buyers to sign up, add products to their cart and place orders. They're all part of the same "web application". So there's the shop, buyer and sellers and ofcourse the site admin.

Would this mean I have a shop app, buyer app and seller app? since they'll all have their profile pages. Or they can all be together a single app?

1
Apps in Django are a way to split up the logic of your site into smaller modules. Deciding where to split into separate apps is a matter of opinion, but usually it depends on how much functionality there's going to be and how much interaction between different pieces. You might want to separate a lot of the logic for sellers (adding products) from that of buyers (viewing/buying products). But also you'll want to avoid circular dependencies in your code and splitting interrelated objects into separate apps can cause dependency issues. Draw out how your models will interact to help you decideHenry Woody

1 Answers

1
votes

Apps structure must contain similar group of models ans behaviours. It' something subjective and on little details it can change a little bit, but you must try to make it most simple and intuitive for everyone. For example, for a shop project, i would create these apps: configuration, users, products, orders, discounts...

So ... No. Not every model in Django has to have a correspondind reusable app.