错误可能:1. 在你的app目录下新建templatetags文件夹里没创建__init__.py定义为包2. 程序编写问题在templatetags下创建myfilter.py 文件html文件中3.settings.py未设置