我有此错误,原因是什么? get error
是什么意思,此任务的解决方案是什么?
AttributeError:“ Aries”对象没有属性“ get”
[22 / Sep / 2020 11:30:51]“ GET / aries HTTP / 1.1” 500 65607
Views.py
def Zodiac(request):
forms = Aries.objects.all()
args = {'forms':forms}
return render(request,'html/aries.html',args)
html 每天
<div class="period_date">
{% block text %}
{% for date in forms %}
{%if forloop.last%}
Published on {{date.pub_date}}
{% endif %}
{% endfor %}</div>
{% endblock text %}
model.py
class Aries(models.Model):
pub_date = models.DateField()
body_text = models.TextField()
love_text = models.TextField(null=True)