【发布时间】:2017-04-10 16:37:57
【问题描述】:
我正在尝试在页面顶部添加对象旁边的 change_list django 管理页面中添加一个自定义按钮。
{% extends "admin/change_list.html" %}
{% load i18n %}
{% block object-tools-items %}
{{ block.super }}
<li>
<button class="" href="...">Click Here!</button>
</li>
{% endblock %}
我遵循了很多教程,但没有成功。
我的 settings.py 中有'APP_DIRS': True,,我的项目如下:
project/
app/
templates/
change_list.html
custom_template.html
custom_template.html 是 change_list 中的一个 Action,它可以工作。
我错过了什么吗?
编辑:
已经试过了:
project/app/templates/admin/change_list.html project/app/templates/app/admin/change_list.html
也没有用。
【问题讨论】:
-
基于这个问题,您好像忘记在扩展标签*.com/questions/6583877/…中指定应用名称了
标签: python django django-admin django-1.10