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

素颜马尾好姑娘i 2021-07-26 12:45 616阅读 0赞

【问题描述】

  1. 今天在构建django-rest-swagger的时候报了如下的错误:
  2. django.template.exceptions.TemplateSyntaxError: 'staticfiles' is not a registered tag library. Must be one of:
  3. admin_list
  4. admin_modify
  5. admin_urls
  6. cache
  7. i18n
  8. l10n
  9. log
  10. rest_framework
  11. static
  12. tz

【解决办法】

  1. setting.py中添加如下内容:
  2. 'libraries': { # Adding this section should work around the issue.
  3. 'staticfiles': 'django.templatetags.static',
  4. },

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dka3l4eTIwMTM_size_16_color_FFFFFF_t_70

发表评论

表情:
评论列表 (有 0 条评论,616人围观)

还没有评论,来说两句吧...

相关阅读