何时在Django中创建一个新应用程序(带有startapp)? [英] When to create a new app (with startapp) in Django?

查看:389
本文介绍了何时在Django中创建一个新应用程序(带有startapp)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经google了这个,但我仍然遇到了Django定义为应用程序的麻烦。

I've googled around for this, but I still have trouble relating to what Django defines as "apps".

我应该为网站中的每个功能创建一个新的应用程序,即使它使用主项目的模型?

Should I create a new app for each piece of functionality in a site, even though it uses models from the main project?

你们有什么时候分裂一个新的应用程序,以及何时将功能与主要项目或其他应用程序保持一致? p>

Do you guys have good rule of thumb of when to split off a new app, and when to keep functionality together with the "main project" or other apps?

推荐答案

詹姆斯·班内特有一个美好的幻灯片关于如何在Django中组织可重复使用的应用程序。

James Bennett has a wonderful set of slides on how to organize reusable apps in Django.

这篇关于何时在Django中创建一个新应用程序(带有startapp)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆