url.py
url(r'^blog/(?P<slug>[-\W]+)/$', views.blog, name='blog'),
index.html
<div class="blog_section">
{% for blog in blogs%}
<h1>{{ blog }}</h1>
<p class="post_time">
<i class="fa fa-clock-o" aria-hidden="true"></i>
{{ blog.time }}
{% if request.user.is_authenticated %}
{% if request.user.is_admin %}
<a href="{% url 'main:editblog' %}"><i class="fa fa-pencil" aria-hidden="true"></i></a>
<a href=""><i class="fa fa-times" aria-hidden="true"></i></a>
{% endif%}
{% endif%}
</p>
<hr>
{{ blog.perex|safe}}
<a href="{% url 'main:blog/get_absolute_url' %}" class="whole_text">Полный текст
<i class="fa fa-angle-right" aria-hidden="true"></i></a>
{% endfor %}
</div>
views.py
def index(request):
return TemplateResponse(request, "main/index.html", {'blogs':Blog.objects.all()})
def blog(request, slug):
blog = get_object_or_404(Blog, slug = slug)
return TemplateResponse(request, "main/blog.html", {'blog': blog})
blog.html
{% extends, "base.html" %}
{% block content %}
<h1>{{ blog }}<small>{{ blog.time }}</small></h1>
{{ blog.perex|safe }} <hr/>
{{ blog.content|safe }}
{% endblock %}
Reverse for 'blog/get_absolute_url' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Когда добавляю "Полный текст" для открытия блога выводит эту ошибку