0
誰のトラブルは、次のコードでエラーを撮影することができます:正規表現
コード:(ブログアプリであるblog.htmlファイル、中)
1 {% extends "aboutme/header.html" %}
2
3 {%block content %}
4 {% for post in object_list %}
5 <h5>{{post.date|date:Y-m-d"}}<a href="/blog/{{post.id}}">{{post.title}}</a></h5>
6 {% end for %}
7 {% endblock %}
ランニングの
エラー:http://127.0.0.1:8000/blog/
TemplateSyntaxError at /blog/
Could not parse the remainder: '-m-d"' from 'post.date|date:Y-m-d"'
Request Method: GET
Request URL: http://127.0.0.1:8000/blog/
Django Version: 2.0
Exception Type: TemplateSyntaxError
Exception Value:
Could not parse the remainder: '-m-d"' from 'post.date|date:Y-m-d"'
Exception Location: C:\Python34\lib\site-packages\django\template\base.py in __init__, line 668
Python Executable: C:\Python34\python.exe
Python Version: 3.4.3
Python Path:
['C:\\Users\\User\\Desktop\\pythonsite\\mysite',
'C:\\windows\\SYSTEM32\\python34.zip',
'C:\\Python34\\DLLs',
'C:\\Python34\\lib',
'C:\\Python34',
'C:\\Python34\\lib\\site-packages']
Server time: Wed, 13 Dec 2017 19:13:00 +0000
Error during template rendering
In template C:\Users\User\Desktop\pythonsite\mysite\blog\templates\blog\blog.html, error at line 5
Could not parse the remainder: '-m-d"' from 'post.date|date:Y-m-d"'
1 {% extends "aboutme/header.html" %}
2
3 {%block content %}
4 {% for post in object_list %}
5 <h5>{{post.date|date:Y-m-d"}}<a href="/blog/{{post.id}}">{{post.title}}</a></h5>
6 {% end for %}
7 {% endblock %}