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

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -