【问题标题】:Django grappeli - include link to custom admin page in side-panel dropdown-menuDjango grappeli - 在侧面板下拉菜单中包含指向自定义管理页面的链接
【发布时间】:2014-10-21 11:08:21
【问题描述】:

我使用带有 Mezzaine 的 Django 1.7。

我根据以下内容创建自定义管理页面: Django - custom admin page not releated to a model

我想在 grappeli 侧面板下拉菜单中包含指向该页面的链接。有没有办法在不触摸侧面板模板的情况下实现这一点?

【问题讨论】:

    标签: django mezzanine django-grappelli


    【解决方案1】:

    在您的settings.py 中查找ADMIN_MENU_ORDER-常量。

    大概是这样的:

    # ADMIN_MENU_ORDER = (
    #     ("Content", ("pages.Page", "blog.BlogPost",
    #        "generic.ThreadedComment", ("Media Library", "fb_browse"),)),
    #     ("Site", ("sites.Site", "redirects.Redirect", "conf.Setting")),
    #     ("Users", ("auth.User", "auth.Group",)),
    # )
    

    您必须先取消注释这些行。假设您最近创建的管理页面名为verycustom.SuchCustomPage,您必须将其插入菜单列表中的所需位置。

    例子:

    ADMIN_MENU_ORDER = (
         ("Content", ("pages.Page", "verycustom.SuchCustomPage", "blog.BlogPost",
            "generic.ThreadedComment", ("Media Library", "fb_browse"))),
         ("Site", ("sites.Site", "redirects.Redirect", "conf.Setting")),
         ("Users", ("auth.User", "auth.Group",)),
    )
    

    编辑:官方documentation有详细解释。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-19
      相关资源
      最近更新 更多