Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Django Class-based Views Classy Views CRUDs

Hmm, `ArticleDelete` doesn't seem to have the correct template

I dont get why my answer is wrong

articles/views.py
from django.views.generic import ListView, DetailView
from django.views.generic.edit import CreateView, UpdateView, DeleteView



from . import models


class ArticleList(ListView):
    model = models.Article


class ArticleDetail(DetailView):
    model = models.Article

class ArticleCreate(CreateView):
    fields = ['title','body','author', 'published']
    model  = models.Article

class ArticleUpdate(UpdateView):
    fields = ['title','body','author', 'published']
    model = models.Article

class ArticleDelete(DeleteView):
    model = models.Article
articles/templates/articles/article_form.html
<form method='post'>
  {% csrf_token %}
  {{ form.as_p}}
  <input type="submit" />
</form>
articles/templates/articles/article_confirm_delete.html
<h1>Delete {{ article.title }}?</h1>
<form method="POST">
  {% csrf_token %}
  <input type="submit"/> <a href="{% url 'articles:detail'%}">cancle</a>
</form>

1 Answer

Tatiana Vasilevskaya
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Tatiana Vasilevskaya
Python Web Development Techdegree Graduate 28,600 Points

<a href="{% url 'articles:detail'%}">cancle</a> The problem is here, you make a link to the article's detail page, however you do not pass the article's pk argument.

You also have a typo in the word cancel. :)

Thanks! It worked