TemplateSyntaxError at Invalid block tag on line 27: 'static', expected 'endblock'. register or loa

错误

TemplateSyntaxError at /blogs/index/

Invalid block tag on line 27: 'static', expected 'endblock'. Did you forget to register or load this tag?

Request Method: 	GET
Request URL: 	http://127.0.0.1:8000/blogs/index/?page=1
Django Version: 	2.2.10
Exception Type: 	TemplateSyntaxError
Exception Value: 	

Invalid block tag on line 27: 'static', expected 'endblock'. Did you forget to register or load this tag?

Exception Location: 	C:\Programs\Miniconda3\envs\djg2env\lib\site-packages\django\template\base.py in invalid_block_tag, line 528
Python Executable: 	C:\Programs\Miniconda3\envs\djg2env\python.exe
Python Version: 	3.7.4
Python Path: 	

['E:\\MySites\\xsite\\apps',
 'E:\\MySites\\xsite',
 'E:\\MySites\\xsite',
 'E:\\MySites\\xsite',
 'E:\\MySites\\xsite\\apps',
 'E:\\MySites\\xsite\\dbtools',
 'C:\\Programs\\PyCharm\\plugins\\python\\helpers\\pycharm_display',
 'C:\\Programs\\Miniconda3\\envs\\djg2env\\python37.zip',
 'C:\\Programs\\Miniconda3\\envs\\djg2env\\DLLs',
 'C:\\Programs\\Miniconda3\\envs\\djg2env\\lib',
 'C:\\Programs\\Miniconda3\\envs\\djg2env',
 'C:\\Programs\\Miniconda3\\envs\\djg2env\\lib\\site-packages',
 'C:\\Programs\\PyCharm\\plugins\\python\\helpers\\pycharm_matplotlib_backend']

Server time: 	星期四, 26 三月 2020 22:06:49 +0800
Error during template rendering

In template E:\MySites\xsite\templates\aiblogs\blog_index.html, error at line 27
Invalid block tag on line 27: 'static', expected 'endblock'. Did you forget to register or load this tag?
17 	
18 	{% block content %}
19 	
20 	    <div class="container-fluid">
21 	        <div class="row" style="background-color: rgba(212, 208, 208, 0.24)">
22 	            <h5 style="margin-left: 80px; margin-top: 10px;margin-bottom: 15px">那些听不见音乐的人,认为那些跳舞的人疯了! ------尼采·1662</h5>
23 	        </div>
24 	        <div class="row mt-4">
25 	            <div class="col-1"></div>
26 	            <div class="col-2">
27 	                <img src="{% static 'images/robot_dance.jpg' %}"/>
28 	            </div>
29 	            <div class="col-8">
30 	                <ul class="list-unstyled">
31 	                    {% for article in article_list %}
32 	                        {% with userprofile=article.user.profile domain_name=article.domain.name updown_count=article.articleupdown_set.count %}
33 	                            <li class="media border-bottom border-right shadow-sm p-1 mb-4 bg-white rounded">
34 	                                <div class="media-body">
35 	                                    <h5 class="mt-0 mb-4">
36 	                                        <a class="text-dark text-decoration-none" href="{{ article.get_absolute_url }}" target="_blank">{{ article.title }}</a>
37 	                                    </h5>
Traceback Switch to copy-and-paste view

    C:\Programs\Miniconda3\envs\djg2env\lib\site-packages\django\template\base.py in parse

                            compile_func = self.tags[command]

         …
    ▶ Local vars
    During handling of the above exception ('static'), another exception occurred:
    C:\Programs\Miniconda3\envs\djg2env\lib\site-packages\django\core\handlers\exception.py in inner

                    response = get_response(request)

         …
    ▶ Local vars
    C:\Programs\Miniconda3\envs\djg2env\lib\site-packages\django\core\handlers\base.py in _get_response

                        response = self.process_exception_by_middleware(e, request)

         …
    ▶ Local vars
    C:\Programs\Miniconda3\envs\djg2env\lib\site-packages\django\core\handlers\base.py in _get_response

                        response = response.render()

         …
    ▶ Local vars
    C:\Programs\Miniconda3\envs\djg2env\lib\site-packages\django\template\response.py in render

                    self.content = self.rendered_content

         …
    ▶ Local vars
    C:\Programs\Miniconda3\envs\djg2env\lib\site-packages\django\template\response.py in rendered_content

                template = self.resolve_template(self.template_name)

Django 高级实战编程

Django高级实战 开发企业级问答网站
项目结合:需求分析/Django高级用法/算法/设计模式/TestCase测试/云计算服务

Django开发企业实战 面向就业/升职(中高级教程)

视频教程分享地址:
https://study.163.com/course/introduction/1209407824.htm?share=2&shareId=400000000535031

解决办法

{% extends 'base.html' %}
{% load staticfiles %} 
{% block head_title %}博客首页 - {{ block.super }} {% endblock %}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值