Environment Request Method GET Request URL http 127 8000 blog Django V

  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
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/blog/
Django Version: 1.0-final-SVN-unknown
Python Version: 2.6.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'links',
'django.contrib.admin',
'blog',
'django.contrib.comments']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware')
Template error:
In template d:\prjcts\django\testproject\templates\blog\index.html, error at line 10
Caught an exception while rendering: 'str' object has no attribute '_meta'
1 : {% extends "base.html" %}
2 :
3 : {% block title %}Blog - {{ block.super }}{% endblock %}
4 : {% for entry in posts.object_list %}
5 : {% block post_area %}
6 : {% block post_title %}<a href="/blog/post/{{ i.id }}">{{ entry.title }}</a>{% endblock %}
7 : {% block post_description %}{{ entry.description }}{% endblock %}
8 : {% block post_comment_date %}
9 : {% load comments %}
10 : {% get_comment_count for entry as comment_count %}
11 : <p align="right"> - {{ entry.post_time|date:"jS F Y H:i" }} - <a href="/blog/post/{{ entry.id }}">{{ comment_count }} comments </a></p>
12 : {% endblock %}
13 : </div>
14 : <b class="xbottom"><b class="xb4"></b><b class="xb3"></b>
15 : <b class="xb2"></b><b class="xb1"></b></b>
16 : </div>
17 : {% endblock %}
18 : {% endfor %}
19 : {% block paginator %}
20 : {% if posts.has_previous %}
Traceback:
File "C:\Python26\lib\site-packages\django\core\handlers\base.py" in get_response
86. response = callback(request, *callback_args, **callback_kwargs)
File "D:\prjcts\django\testproject\..\testproject\blog\views.py" in blog
24. {"posts": posts},
File "C:\Python26\lib\site-packages\django\shortcuts\__init__.py" in render_to_response
18. return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "C:\Python26\lib\site-packages\django\template\loader.py" in render_to_string
107. return t.render(context_instance)
File "C:\Python26\lib\site-packages\django\template\__init__.py" in render
176. return self.nodelist.render(context)
File "C:\Python26\lib\site-packages\django\template\__init__.py" in render
768. bits.append(self.render_node(node, context))
File "C:\Python26\lib\site-packages\django\template\debug.py" in render_node
71. result = node.render(context)
File "C:\Python26\lib\site-packages\django\template\loader_tags.py" in render
97. return compiled_parent.render(context)
File "C:\Python26\lib\site-packages\django\template\__init__.py" in render
176. return self.nodelist.render(context)
File "C:\Python26\lib\site-packages\django\template\__init__.py" in render
768. bits.append(self.render_node(node, context))
File "C:\Python26\lib\site-packages\django\template\debug.py" in render_node
71. result = node.render(context)
File "C:\Python26\lib\site-packages\django\template\loader_tags.py" in render
24. result = self.nodelist.render(context)
File "C:\Python26\lib\site-packages\django\template\__init__.py" in render
768. bits.append(self.render_node(node, context))
File "C:\Python26\lib\site-packages\django\template\debug.py" in render_node
71. result = node.render(context)
File "C:\Python26\lib\site-packages\django\template\loader_tags.py" in render
24. result = self.nodelist.render(context)
File "C:\Python26\lib\site-packages\django\template\__init__.py" in render
768. bits.append(self.render_node(node, context))
File "C:\Python26\lib\site-packages\django\template\debug.py" in render_node
81. raise wrapped
Exception Type: TemplateSyntaxError at /blog/
Exception Value: Caught an exception while rendering: 'str' object has no attribute '_meta'