【问题标题】:What is the best experinces to structure a Django project for scale? [closed]构建可扩展的 Django 项目的最佳经验是什么? [关闭]
【发布时间】:2023-01-20 21:48:19
【问题描述】:

姜戈很棒。但是随着我们添加新功能,随着我们开发团队的壮大,软件需要在生产环境中保持稳定,事情可能会变得非常混乱。

我们将需要一些源自经验的通用模式,以了解如何构建 Django 项目以实现规模和寿命。

你有什么建议?

的确,有很多发展模式和模式,但我们想知道您的经验。

编辑:我发现了这个,我认为它很有帮助,但我的问题是,经验说明了什么? https://maktabkhooneh.org/mag/wp-content/uploads/2022/04/Django-Design-Patterns-and-Best-Practices.pdf

【问题讨论】:

    标签: python django django-rest-framework


    【解决方案1】:

    我可以在下面列出你在大型项目中应该遵循的要点

    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
    

    请务必阅读以下文章阅读以上内容 https://medium.com/@DoorDash/tips-for-building-high-quality-django-apps-at-scale-a5a25917b2b5

    【讨论】:

    • 感谢@007Coding
    • 别客气。
    猜你喜欢
    • 2010-10-09
    • 1970-01-01
    • 1970-01-01
    • 2013-06-19
    • 1970-01-01
    • 1970-01-01
    • 2014-07-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多