I cannot do the following in Django:
{% include "admin/includes/pager.html" with title_pager="{{myobject.title}}" %}
or
{% include "admin/includes/pager.html" with title_pager="{{myobject}}" %}
What is the workaround?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With