Chr*_*ris 5 django django-models python-2.7
我正在创建一篇博客文章,在成功迁移我的博客文件后,当我访问我网站的博客页面时,我返回了一个错误(无法解析剩余部分:':'ymd''来自'post.date | date: "年月日"")
我似乎无法找到这是语法错误还是逻辑错误
HTML:
{% extends "personal/header.html" %}
{% block content %}
{% for post in object_list %}
<h5> {{ post.date|date: "Y-m-d"}} <a href="/blog/{{ post.id }}"> {{ post.title }} </a> </h5>
{% endfor %}
{% endblock %}
Run Code Online (Sandbox Code Playgroud)
Python(models.py):
from django.db import models
class Post (models.Model):
title = models.CharField(max_length=140)
body = models.TextField()
date = models.DateTimeField()
def __unicode__(self):
return self.title
Run Code Online (Sandbox Code Playgroud)