As my Django projects are bigger and bigger I am facing issues regarding architecture. Before starting to code, I spend a lot of time to find a nice architecture for my project: how I split my project in apps, which apps are dependent on other apps and so on. To be clear, by architecture I don't mean project layout.
I have done my research and I haven't found yet a ressource showcasing some methods to find the best architecture for a given Django project. Outside web development, UML seems to be the way to go.
My questions are:
1) Why is there almost no discussion about those topics on the internet ? Am I missing something and totally wrong in my approach ?
2) Can UML be used to work on Django project architecture ?
3) Is there a common way to tackle this issue with Django ?
Django root directory is the default app which Django provides you. It contains the files which will be used in maintaining the whole project. The name of Django root directory is the same as the project name you mentioned in django-admin startproject [projectname].
Starting a Django project allows you to build your application's entire data model in Python without needing to use SQL. Using an object-relational mapper (ORM), Django converts traditional database structure into Python classes to make it easier to work within a fully Python environment.
You can cache output of your specified views as per your need , or cache those views which are difficult to produce , or you can even cache the entire site . So this was the workflow of Django , i.e how these components interact with each other and makes Django a powerful Web Development Framework.
Before starting to code, I spend a lot of time to find a nice architecture for my project: how I split my project in apps, which apps are dependent on other apps and so on.
I think you're overthinking this. Your project architecture can (& probably should) evolve as you go. You can start with 1 big app and then split it when the appropriate structure becomes obvious to you.
1) Why is there almost no discussion about those topics on the internet ? Am I missing something and totally wrong in my approach ?
Because the short answer is "it's up to you" or "it depends on your project". This will help you: Django: best practice for splitting up project into apps
2) Can UML be used to work on Django project architecture ?
I don't see why not.
3) Is there a common way to tackle this issue with Django ?
There are several ways, consider dividing your apps around:
If you would like to have some guidance on how to create a UML design for a web application, you may like my white paper "Technical design in UML for AngularJS applications". It focuses on Angular apps, but most of it applies to web apps in general.
After gathering more information I came accross an interesting architecture (I have found the idea on reddit but could not retrieve the url).
Your whole code should be sperated into independent apps (separation of concern) and you need to define 2 "project wide" apps (site and utils):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With