Django应用程序结构,好的做法? [英] Django app structure, good practice?

查看:51
本文介绍了Django应用程序结构,好的做法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Django的新手,目前正在为如何构建应用程序而苦苦挣扎.

I'm new to Django and am currently struggling with how to structure the apps.

该站点是一个具有公共前端的站点,您可以在其中登录以进入仪表板.我为此仪表板创建了一个单独的应用程序.

The site is one with a public frontend, in which you can login to enter a dashboard. I've created a separate app for this dashboard.

现在,我想在此仪表板的一页上显示员工列表,但是我为这些员工创建了另一个应用程序.

Now I want to display a list of employees on one page of this dashboard, however I've created another app for these employees.

我应该在员工应用程序中创建此新页面/视图吗?还是应该删除此员工应用程序,并将该模型包含在仪表板应用程序中?什么是好的做法?

Should I create this new page/view, in the employees app? Or should I delete this employee app, and include that model in the dashboard app? What is considered good practice?

当前看起来像这样:

-site
-- dashboard app
-- employee app

推荐答案

资料来源: Django的独家新闻:Django 1.8的最佳做法 p-35

Source: Two Scoops of Django: Best Practices for Django 1.8 p-35

这篇关于Django应用程序结构,好的做法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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