Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ArticleDetailView(DetailView):
- template_name = 'article_detail.html'
- context_object_name = 'article'
- model = Article
- def head(self, *args, **kwargs):
- article = get_object_or_404(self.model, slug=self.kwargs.get('slug'))
- response = HttpResponse()
- print response
- response['Last-Modified'] = article.published.strftime('%a, %d %b %Y %H:%M:%S UTC')
- return response
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement