使用django admin创建整个Web应用程序 [英] Creating an entire web application using django admin

查看:110
本文介绍了使用django admin创建整个Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在想,django管理员是一个提供网站信任管理员的实用工具,可以完全访问该网站的数据模型。

I was thinking that django admin is an utility to provide trusted administrators of the site, full access to the site's data model.

然而,经过django管理详细来说,我明白,它是非常强大的一组视图和模板,可以用来创建整个应用程序。

However, after going through django admin in detail, I understand that it is very powerful set of views and templates that one can use to create an entire application.

使用管理员创建整个应用程序的频率单独?使用视图本身比自定义管理员更容易吗?

How often do you create an entire application using admin alone? Is it easier to create using views itself than customizing admin that much?

如何使用管理员构建原型。我们甚至需要构建原型?管理员定制不能在实际应用中重复使用。

How about building prototype using admin. Do we even need to build prototype? The admin customization cannot be re-used in real application.

如果我想在实际应用中使用一部分管理代码(使用不同的模板),是否有一些

If I want to use a part of the admin code in real application (with different templates), is there some kind of scaffolding option available?

推荐答案

管理员不是您的应用程序。

"The Admin is not your app."

如果自定义超出了微不足道的范围,请写下您自己的观点。

If the customization goes beyond the trivial, write your own views.

根据我的经验,我离开内部管理页面相对保持不变。相反,我会覆盖管理员索引模板,当用户需要执行不平凡的报告或表单处理时,我将链接指向定制的视图。

In my experience, I leave the internal admin pages relatively untouched. Instead, I override the admin index template, where I put links to custom-written views when the user needs to do nontrivial reporting or form handling.

这篇关于使用django admin创建整个Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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