'staticfiles' is not a registered tag library. Must be one of:

django.template.exceptions.TemplateSyntaxError: 'staticfiles' is not a registered tag library. Must

复制代码
ROOT_URLCONF = ''

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')]
        ,
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                
            ],
            #添加下面内容
            'libraries': { # Adding this section should work around the issue.
                'staticfiles' : 'django.templatetags.static',
            },
        },
    },
]
复制代码

 

本文作者:香菜哥哥

本文链接:https://www.cnblogs.com/yizhipanghu/p/15346297.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   香菜哥哥  阅读(660)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
展开