I'm trying to customize my admin panel. I have copied change_list.html
to the proper subfolder which is templates -> admin -> model -> change_list.html
While I customize the change_list.html
, I'd like to use a templatetag but I'm not sure where to put my custom template tag library.
When I put it under django/contrib/admin/templatetags/
, it works fine but I want to keep it in my own project tree.
Do you have any idea?
Note: I have also load my template tag in change_list.html
as
{% load adminmedia admin_list i18n grp_tags myproject_tags %}
Thanks.
Do not modify or add anything to directory containing Django (do not modify Django!). Keep everything in your project directory (like in the manual).
Admin templates are exactly the same as non-admin templates and you use custom template tags exactly the same way. Put your template tags in yourapp/templatetags/
directory. If your app is in the settings.INSTALLED_APPS
that you can load it's tags by passing the module name to the load tag. It accepts also package.module
syntax, so: {% load somelibrary %}
or {% load package.otherlibrary %}