python - Django Link to class based views url -
i created django page can delete blog articles using class based views, want add link each article i'm struggling it.
here code link class based view
views.py
user_delete_article = article.objects.filter(user=request.user)
template.html
{% article in user_delete_article %} <p><a class="readmore" href="{% url "article.views.deleteview" article.id %}">{{ article.titre }}</a></p> {% endfor %}
urls.py
url(r'^delete/(?p<id>\d+)/$', deleteview.as_view(), name="deleteview"),
how can make work?
assuming django 1.8
<a href="{% url "deleteview" id=article.id %}">
Comments
Post a Comment