阅读背景:

剂量soundcloud功能如何划分为django应用程序

来源:互联网 

I have read a lot about the rule in django that an app should be focused, an app should do one thing and do it well

我已经阅读了很多关于django中应该关注应用程序的规则,应用程序应该做一件事并且做得好

so if we are talking about 3 main features in a website like sound cloud

所以,如果我们在谈论像云一样的网站中的3个主要功能

Album: which have many songs

专辑:有很多歌

Song: only one song , it could be part of an album

歌曲:只有一首歌,它可能是专辑的一部分

Play list: has an album or some songs

播放列表:有专辑或一些歌曲

how it would be divided into apps in django

它将如何划分为django中的应用程序

should each one have it's own app with it's own models file and use each app in the other as the have relations

应该每个人都拥有自己的应用程序和自己的模型文件,并使用另一个应用程序作为有关系

1 个解决方案

#1


0  

I'd put all this under the same app.

我把所有这些都放在同一个应用程序中。

It is recommended to build a new app when you change focus. For instance, if you decide that you are going to provide videos or pictures. But in this case, the playlist, albums or single is just a mean of display. The logic behind is always the same.

建议您在更改焦点时构建新的应用程序。例如,如果您决定要提供视频或图片。但在这种情况下,播放列表,专辑或单曲只是显示的一种手段。背后的逻辑总是一样的。

Cheers, Julien

干杯,朱利安


分享到: