Page not found (404)
Request Method:
GET
Request URL:
http://127.0.0.1:8000/blog/rss
Raised by:
django.views.generic.detail.DetailView
No post found matching the query
You're seeing this error because you have DEBUG = True in your Django
settings file. Change that to False, and Django will display a standard
404 page.
my feeds.py
from django.contrib.syndication.views import Feed
from blog.models import Post
from django.utils.feedgenerator import Atom1Feed
from django.utils.html import escape
class RssSiteNewsFeed(Feed):
title = "blog rss "
link = "/blog/rss/"
description = "blog rss and atom feeds ."
def items(self):
return Post.objects.order_by('date')[:10]
def item_title(self, item):
return item.title
def item_description(self, item):
return item.description
def item_link(self, item):
return item.get_absolute_url()
class AtomSiteNewsFeed(RssSiteNewsFeed):
feed_type = Atom1Feed
subtitle = RssSiteNewsFeed.description
my models .py
class Post(models.Model):
title = models.CharField (max_length = 160, null=False)
body = models.TextField( null=False)
date = models.DateTimeField()
author = models.CharField (max_length = 160)
description = models.TextField(max_length = 160)
keywords = models.TextField()
category = models.ForeignKey(Category,on_delete=models.DO_NOTHING)
slug = models.SlugField(max_length = 160,unique=True)
img_url = models.URLField()
short_blog_snippet= models.CharField(max_length = 15)
absolute_url = models.CharField(max_length=400, blank=True,
editable=False)
def __str__(self):
return self.title
def get_absolute_url(self ):
return "/blog/%s" % self.slug
def __unicode__(self):
return self.title
I do not know what i am doing wrong .
--
Ticket URL: <https://code.djangoproject.com/ticket/29418>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: BeshoyFarag (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/29418#comment:1>
* Attachment "feeds.py" added.
feeds.py
* Attachment "urls.py" added.
url.py
* Attachment "models.py" added.
blog models.py
Old description:
> def __str__(self):
>
New description:
this is what my Django rss feed returns
Page not found (404)
Request Method:
GET
Request URL:
http://127.0.0.1:8000/blog/rss
Raised by:
django.views.generic.detail.DetailView
No post found matching the query
You're seeing this error because you have DEBUG = True in your Django
settings file. Change that to False, and Django will display a standard
404 page.
I do not know what i am doing wrong .
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29418#comment:2>
* status: new => closed
* resolution: => invalid
Comment:
Please see TicketClosingReasons/UseSupportChannels for ways to get help.
--
Ticket URL: <https://code.djangoproject.com/ticket/29418#comment:3>