Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. class ArticleDetailView(DetailView):
  2. template_name = 'article_detail.html'
  3. context_object_name = 'article'
  4. model = Article
  5.  
  6. def head(self, *args, **kwargs):
  7. article = get_object_or_404(self.model, slug=self.kwargs.get('slug'))
  8. response = HttpResponse()
  9. print response
  10. response['Last-Modified'] = article.published.strftime('%a, %d %b %Y %H:%M:%S UTC')
  11. return response
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement