Answer the question
In order to leave comments, you need to log in
Django how to follow a slug link???
URLs
path('news_detail/<slug:url_news>', news_views.NewsDetail.as_view(), name="news_detail"),
class NewsDetail(View):
def get(self, request, url_news):
context = {}
return render(request, 'news_template/news_detail.html', context)
{% for news in news_list %}
<div class="card bg-light mb-3 d-inline-block">
<div class="card-body">
############################ ошибка в следующей строке, не могу понять в чем????
<h4 class="card-title"><a class="" href="{% url 'news:news_detail' news.url %}">{{ news.title }}</a></h4>
<p class="card-text">
{{ news.short_describe }}
</p>
<a href="#!" class="card-link ">Докладніше</a>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question