python - Django 1.5 extend admin/change_form.html object tools -
i'm new django i've been enjoying it. seem run places don't seem things correct. so, i'm asking , guidance.
i'm trying extend object-tools 1 of models can have print button next history.
my templates follows:
project/app/templates/admin/
i'm successfully extending base_site.html no issues.
project/app/templates/admin/base_site.html
however, when add change_form.html so:
project/app/templates/admin/change_form.html
with following:
{% extends 'admin/change_form.html' %} {% block object-tools %} <a href="one">one</a> <a href="one">two</a> {% endblock %}
i exception: maximum recursion depth exceeded while calling python object
this seems i'm missing quite basic.
things i've tried:
- many variations of {% block %}
- extending base_site, base etc ...
- adding /model part of path (project/app/templates/admin/model/change_form.html)
i'm confused , unsuccessful.
p.s.: i'm using bootstrap theme here http://riccardo.forina.me/bootstrap-your-django-admin-in-3-minutes/ purposes of problem i'm not using it.
the problem admin/change_form.html
in {% extend %}
block getting resolved project/app/templates/admin/change_form.html
.
one solution create subdirectory of templates
named app - possibly project/templates/admin/app/change_form.html
.
in order override 1 or more of them, first create admin directory in project’s templates directory. can of directories specified in template_dirs.
within admin directory, create sub-directories named after app.
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-vs-replacing-an-admin-template
Comments
Post a Comment