How to manage multiple websites with 1 django project

Let's say I have 1 Django project where I want host multiple websites on with different domains. I managed to set it up but progressing further is where I get confused.

We'll call them store1.com, store2.com

I can route to both sites through a custom middleware that checks the url where the request comes from and that is working fine.

Both stores have it's own apps like cart, category, product, account and so forth.

What would be the best practice to structure this?

Do I put everything from a store inside 1 app or is it better to have all these models and views in a separate app and keep checking the request so that the app knows which URL to serve?

IMHO the best way is to create an app for all the different functionalities and then use Django Sites framework to manage multiple sites. You can read more on the Django documentation

Back to Top