[Django]-Django pass object to include

125👍

You do not need to surround arguments in {{ }} brackets in template tags.

If it’s a variable, not a string, then do not use "" quotes.

The following should work:

{% include "admin/includes/pager.html" with title_pager=myobject.title %}

{% include "admin/includes/pager.html" with title_pager=myobject %}

See the Django docs for the include tag for more information.

Leave a comment