What is the best experinces to structure a Django project for scale?
Question:
Django is great. But as we add new features, as our dev team grows, the software needs to be stable on production, things can get quite messy.
We are going to want some common patterns, derived from experience, on how to structure your Django project for scale and longevity.
What is your suggestion?
Indeed, there are many models and patterns for development, but we want to know your experiences.
Edit : I found this and I think it is helpful, but my question is, what does the experience say?
https://maktabkhooneh.org/mag/wp-content/uploads/2022/04/Django-Design-Patterns-and-Best-Practices.pdf
Answers:
I can list the important points below that you should follow in large-scale projects
Organize your apps inside a package
Explicitly name your database tables
Avoid GenericForeignKey
Keep migrations safe
Squash your migrations
Reduce migration friction
Avoid Fat Models
Be careful with signals
Avoid using the ORM as the main interface to your data
Don’t cache Django models
Be sure to read the following article to read each of the above
https://medium.com/@DoorDash/tips-for-building-high-quality-django-apps-at-scale-a5a25917b2b5
Django is great. But as we add new features, as our dev team grows, the software needs to be stable on production, things can get quite messy.
We are going to want some common patterns, derived from experience, on how to structure your Django project for scale and longevity.
What is your suggestion?
Indeed, there are many models and patterns for development, but we want to know your experiences.
Edit : I found this and I think it is helpful, but my question is, what does the experience say?
https://maktabkhooneh.org/mag/wp-content/uploads/2022/04/Django-Design-Patterns-and-Best-Practices.pdf
I can list the important points below that you should follow in large-scale projects
Organize your apps inside a package
Explicitly name your database tables
Avoid GenericForeignKey
Keep migrations safe
Squash your migrations
Reduce migration friction
Avoid Fat Models
Be careful with signals
Avoid using the ORM as the main interface to your data
Don’t cache Django models
Be sure to read the following article to read each of the above
https://medium.com/@DoorDash/tips-for-building-high-quality-django-apps-at-scale-a5a25917b2b5