{% extends 'base.html' %}
{% load staticfiles %}
{% block title %}About{% endblock %}
{% block body_block %}
<div class="page-header">
<h1>About</h1>
</div>
<div>
<p></strong>.</p>
<img width="90" height="100" src="{% static "rango/images/rango-film-review.jpg" %}" alt="Picture of Rango" /> <!-- New line -->
</div>
{% endblock %}
def category(reguest, slug):
context_dict = {}
try:
category = Category.objects.get(slug=slug)
context_dict['category_name'] = category.name
pages = BlogPost.objects.filter(category=category)
context_dict['pages'] = pages
context_dict['category'] = category
except Category.DoesNotExist:
pass
return render(reguest, 'category.html', context_dict)
url(r'^category/(?P<slug>[-\w]+)?$', views.category, name='category'),
{% block category %}
<h1>Категории!</h1>
{% if categories %}
<ul>
{% for category in categories %}
<li>{{ category.name }}</li>
{% endfor %}
</ul>
{% else %}
<strong>Нет записей!</strong>
{% endif %}
{% endblock %}