84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
最近在倒腾个Django的简易blog。期间很多地方需要控制post的显示字数,比如在post_list,feed输出或者其他自定义页面。
turncatewords似乎仅支持英文,那么,Django中文摘要字数怎么控制呢?求大神指点。
turncatewords
ringa_lee
You can use slicing to make post_list only display the first few hundred characters. For example, if your content is content, only the first 100 characters will be displayed. content[:100]
You can use slicing to make post_list only display the first few hundred characters. For example, if your content is content, only the first 100 characters will be displayed. content[:100]