Reputation: 6254
I have a field like this in my Django template:
<p>{{news.description}}<p>
I wanna show the first 50 words of this field. How can I do it?
Upvotes: 22
Views: 14156
Reputation: 4294
From the documentation:
{{ news.description|truncatewords:50 }}
Upvotes: 57