【问题描述】
今天在构建django-rest-swagger的时候报了如下的错误:
django.template.exceptions.TemplateSyntaxError: 'staticfiles' is not a registered tag library. Must be one of:
admin_list
admin_modify
admin_urls
cache
i18n
l10n
log
rest_framework
static
tz
【解决办法】
在setting.py中添加如下内容:
'libraries': { # Adding this section should work around the issue.
'staticfiles': 'django.templatetags.static',
},