Search code examples
pythondjangoweb-applicationsmodularity

Multiple Django apps under the same site


I am thinking of creating a content delivery web application using Django with a MySQL database, and after reading the docs a bit I noted that it is possible to create multiple apps in the same project/site directory.

It may or may not apply to what I want to do, but I was wondering what the motivation behind this architecture is. Why would I want multiple web apps in one site?

For example, Youtube was built around the Django framework, but the entire experience works seamlessly as one application? Is Youtube actually one large web application, or does the project use many applications packaged as one product? If so, why would that be a better option?


Solution

  • There's a good explanation about it in the django docs here and here.

    From my own experience: it helps you to organize your code. If you're planning to create a small application it may not need more than one django application. But it you want to create medium or large applications you can take advantages of this approach. Some of useful cases:

    • Authentication
    • Blog
    • Split your RESTFul API based on resources (e.g. clients, invoices, users, etc)
    • Logging
    • Chat

    Hope that helps a bit.