search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

1 answers
Q&A Django中文摘要字数怎么控制?
Django中文摘要字数怎么控制?
高洛峰 2016-11-15 16:28:48 Views 1464

0

最近在倒腾个Django的简易blog。期间很多地方需要控制post的显示字数,比如在post_list,feed输出或者其他自定义页面。

turncatewords 似乎仅支持英文,那么,Django中文摘要字数怎么控制呢?求大神指点。


Your Answer
submit

1 answers
0

你可以用切片让 post_list 只显示前几百个字 比如你的 内容是 content 只显示前100个字 content[:100]

2016-11-15 16:29:00

submit

Popular tool

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use