티스토리 뷰

 

쟝고 프레임워크에서

빅데이터 크롤링한 것을 차트로 그려서

웹페이지에서 보려고 할 때, 뜬 에러

 

TemplateSyntaxError at /chart/

Invalid block tag on line 10: 'static'. Did you forget to register or load this tag?

Request Method:Request URL:Django Version:Exception Type:Exception Value:Exception Location:Python Executable:Python Version:Python Path:Server time:

GET
http://localhost/chart/
4.0.5
TemplateSyntaxError
 
C:\Users\admin\anaconda3\lib\site-packages\django\template\base.py, line 568, in invalid_block_tag
C:\Users\admin\anaconda3\python.exe
3.9.12
 
Fri, 08 Jul 2022 10:35:48 +0900

Error during template rendering

In template D:\work\django\pyweb_board\board\templates\bigdata_pro\chart.html, error at line 10

Invalid block tag on line 10: 'static'. Did you forget to register or load this tag?

123456789101112

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<!-- 저장한 이미지 바로 불러오겠다. -->
{{data}}<br><br>
<img src="{% static 'images/fig01.png' %}" width=800, height=400>
</body>
</html>
 

 


ERROR Solution : 

chart.html 파일에서

{% load static  %}  #파일 불러올 때, 이거 설정해줘야 함!!!!
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<!-- 저장한 이미지 바로 불러오겠다. -->
{{data}}<br><br>
<img src="{% static 'images/fig01.png' %}" width=800, height=400>
</body>
</html>

 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함