Django{% load staticfiles %}->{% load static %}

Internal Server Error: /
Traceback (most recent call last):
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\template\defaulttags.py", line 1034, in find_library
    return parser.libraries[name]
KeyError: 'staticfiles'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
    response = get_response(request)
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "D:\python\pycharm\work\ComputeDemo\app\views.py", line 24, in home
    'app/home.html',
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\shortcuts.py", line 19, in render
    content = loader.render_to_string(template_name, context, request, using=using)
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\template\loader.py", line 61, in render_to_string
    template = get_template(template_name, using=using)
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\template\loader.py", line 15, in get_template
    return engine.get_template(template_name)
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\template\backends\django.py", line 34, in get_template
    return Template(self.engine.get_template(template_name), self)
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\template\engine.py", line 143, in get_template
    template, origin = self.find_template(template_name)
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\template\engine.py", line 125, in find_template
    template = loader.get_template(name, skip=skip)
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\template\loaders\base.py", line 30, in get_template
    contents, origin, origin.template_name, self.engine,
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\template\base.py", line 155, in __init__
    self.nodelist = self.compile_nodelist()
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\template\base.py", line 193, in compile_nodelist
    return parser.parse()
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\template\base.py", line 478, in parse
    raise self.error(token, e)
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\template\base.py", line 476, in parse
    compiled_result = compile_func(self, token)
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\template\defaulttags.py", line 1091, in load
    lib = find_library(parser, name)
  File "D:\python\abaconda3\anzhuang\lib\site-packages\django\template\defaulttags.py", line 1038, in find_library
    name, "\n".join(sorted(parser.libraries)),
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
static
tz
[08/Apr/2021 09:33:48] "GET / HTTP/1.1" 500 142342
Not Found: /favicon.ico
[08/Apr/2021 09:33:48] "GET /favicon.ico HTTP/1.1" 404 2135


{% load staticfiles %} {% load adminstatic %} 是在 Django 2.1的方法, 在 Django 3.0已经修改了

改为{% load static %}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

嗯呢嗯呢

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值