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

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

问题描述

我认为 django admin 是一种实用程序,可为站点的受信任管理员提供对站点数据模型的完全访问权限.

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 admin 后,我了解到它是一组非常强大的视图和模板,可以用来创建整个应用程序.

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.

您多久单独使用 admin 创建一个完整的应用程序?使用视图本身创建比自定义管理更容易吗?

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天全站免登陆