[Answered ]-How to print first 100 character in django?

1👍

You can just use the truncatechars built-in template filter:

{{ dt.faq_info | truncatechars:100 }}

If you really want to use string slicing you should use slice:

{% else %}
    {{ dt.faq_info | slice:":100" }}
👤Selcuk

Leave a comment