• <small id='gfD3s'></small><noframes id='gfD3s'>

    • <bdo id='gfD3s'></bdo><ul id='gfD3s'></ul>

      <tfoot id='gfD3s'></tfoot>
      <legend id='gfD3s'><style id='gfD3s'><dir id='gfD3s'><q id='gfD3s'></q></dir></style></legend>

    1. <i id='gfD3s'><tr id='gfD3s'><dt id='gfD3s'><q id='gfD3s'><span id='gfD3s'><b id='gfD3s'><form id='gfD3s'><ins id='gfD3s'></ins><ul id='gfD3s'></ul><sub id='gfD3s'></sub></form><legend id='gfD3s'></legend><bdo id='gfD3s'><pre id='gfD3s'><center id='gfD3s'></center></pre></bdo></b><th id='gfD3s'></th></span></q></dt></tr></i><div id='gfD3s'><tfoot id='gfD3s'></tfoot><dl id='gfD3s'><fieldset id='gfD3s'></fieldset></dl></div>

        django admin 的有效用例?

        Valid use case for django admin?(django admin 的有效用例?)
        • <legend id='M1nGn'><style id='M1nGn'><dir id='M1nGn'><q id='M1nGn'></q></dir></style></legend>
          <i id='M1nGn'><tr id='M1nGn'><dt id='M1nGn'><q id='M1nGn'><span id='M1nGn'><b id='M1nGn'><form id='M1nGn'><ins id='M1nGn'></ins><ul id='M1nGn'></ul><sub id='M1nGn'></sub></form><legend id='M1nGn'></legend><bdo id='M1nGn'><pre id='M1nGn'><center id='M1nGn'></center></pre></bdo></b><th id='M1nGn'></th></span></q></dt></tr></i><div id='M1nGn'><tfoot id='M1nGn'></tfoot><dl id='M1nGn'><fieldset id='M1nGn'></fieldset></dl></div>

            <tbody id='M1nGn'></tbody>
            • <bdo id='M1nGn'></bdo><ul id='M1nGn'></ul>

              1. <tfoot id='M1nGn'></tfoot>

                  <small id='M1nGn'></small><noframes id='M1nGn'>

                1. 本文介绍了django admin 的有效用例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想建立一个 django 站点,让某些受信任的用户可以编辑他们的个人资料信息.让每个受信任的用户都通过 django 管理界面有意义吗?我只希望他们能够查看和编辑自己的信息(显然).这似乎不符合 django 人定义信任"的方式,尤其是粗体字...

                  I want to build a django site where a certain group of trusted users can edit their profile information. Does it make sense to have each trusted user go through the django admin interface? I'd only want them to be able to see and edit their own information (obviously). It doesn't seem like this fits the way the django people define "trust", especially the bolded bit...

                  来自 Django 书,第 18 章:

                  管理员旨在供以下人员使用你,开发者,信任的人.这不仅仅意味着那些已通过身份验证;"它的意思是Django 假设你的内容编辑可以被信任做正确的事东西.

                  The admin is designed to be used by people who you, the developer, trust. This doesn’t just mean "people who have been authenticated;" it means that Django assumes that your content editors can be trusted to do the right thing.

                  这意味着没有批准"编辑内容的过程——如果你相信你的用户,没有人需要批准他们的编辑.这也意味着权限系统,而功能强大,不支持限制基于每个对象的访问.如果你相信某人编辑他们自己的故事,你相信他们不会编辑其他人未经许可.

                  This means that there’s no "approval" process for editing content — if you trust your users, nobody needs to approve of their edits. It also means that the permission system, while powerful, has no support for limiting access on a per-object basis. If you trust someone to edit their own stories, you trust them not to edit anyone else’s without permission.

                  这是适合 django 管理模块的用例之一,还是只是为不受信任的用户提供的专用视图?

                  Is this one of those use cases that fits with django's admin module, or is it just a specialized view for a non-trusted user?

                  推荐答案

                  不,Django 管理员不适合单个用户配置文件,每个用户都可以查看和编辑所有其他用户配置文件.这更适合需要同时管理所有用户的管理员.

                  No, the Django admin is not suited for individual user profiles, each user would be able to see, and edit, all other user profiles. This is suited more to an administrator who has to manage all the users at once.

                  您需要构建的是用户个人资料页面.Django 已经有了一个不错的登录系统,由 django.contrib.auth 模块提供.您可以轻松地将其集成到您的页面中,这正是 Django 管理员用来验证用户的方式.

                  What you need to build is a user profile page. Django already has a nice login system courtesy of the django.contrib.auth module. You can easily integrate this into your pages, and its exactly what the Django admin uses to authenticate users.

                  接下来,您必须构建一个简单的页面,根据用户模型公开该特定用户的个人资料信息.这应该相对轻松,因为它只需要一个视图和一个模板,并且模板可以利用 ModelForms.

                  Next you'll have to build a simple page that exposes that specific user's profile information based on their User model. This should be relatively painless as it will only require one view and one template, and the template can take advantage of ModelForms.

                  这篇关于django admin 的有效用例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  What happens when you compare 2 pandas Series(当你比较 2 个 pandas 系列时会发生什么)
                  Quickly find differences between two large text files(快速查找两个大文本文件之间的差异)
                  Python - Compare 2 files and output differences(Python - 比较 2 个文件和输出差异)
                  Why do comparisions between very large float values fail in python?(为什么在 python 中非常大的浮点值之间的比较会失败?)
                  Dictionary merge by updating but not overwriting if value exists(字典通过更新合并,但如果值存在则不覆盖)
                  Find entries of one text file in another file in python(在python中的另一个文件中查找一个文本文件的条目)

                      <small id='KsyyD'></small><noframes id='KsyyD'>

                    1. <tfoot id='KsyyD'></tfoot><legend id='KsyyD'><style id='KsyyD'><dir id='KsyyD'><q id='KsyyD'></q></dir></style></legend>
                      <i id='KsyyD'><tr id='KsyyD'><dt id='KsyyD'><q id='KsyyD'><span id='KsyyD'><b id='KsyyD'><form id='KsyyD'><ins id='KsyyD'></ins><ul id='KsyyD'></ul><sub id='KsyyD'></sub></form><legend id='KsyyD'></legend><bdo id='KsyyD'><pre id='KsyyD'><center id='KsyyD'></center></pre></bdo></b><th id='KsyyD'></th></span></q></dt></tr></i><div id='KsyyD'><tfoot id='KsyyD'></tfoot><dl id='KsyyD'><fieldset id='KsyyD'></fieldset></dl></div>

                        <tbody id='KsyyD'></tbody>
                      • <bdo id='KsyyD'></bdo><ul id='KsyyD'></ul>