[Django] #29418: rss feed returnes 404

11 views
Skip to first unread message

Django

unread,
May 19, 2018, 4:53:01 PM5/19/18
to django-...@googlegroups.com
#29418: rss feed returnes 404
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
beshoyfarag |
Type: Bug | Status: new
Component: | Version: 2.0
contrib.syndication |
Severity: Normal | Keywords: 404 , rss ,atom
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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.

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.

Django

unread,
May 19, 2018, 4:54:18 PM5/19/18
to django-...@googlegroups.com
#29418: rss feed returnes 404
-------------------------------------+-------------------------------------
Reporter: BeshoyFarag | Owner: nobody
Type: Bug | Status: new
Component: contrib.syndication | Version: 2.0
Severity: Normal | Resolution:

Keywords: 404 , rss ,atom | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by BeshoyFarag):

* cc: BeshoyFarag (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/29418#comment:1>

Django

unread,
May 19, 2018, 4:57:07 PM5/19/18
to django-...@googlegroups.com
#29418: rss feed returnes 404
-------------------------------------+-------------------------------------
Reporter: BeshoyFarag | Owner: nobody
Type: Bug | Status: new

Component: contrib.syndication | Version: 2.0
Severity: Normal | Resolution:
Keywords: 404 , rss ,atom | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by BeshoyFarag):

* Attachment "feeds.py" added.

feeds.py

Django

unread,
May 19, 2018, 4:57:29 PM5/19/18
to django-...@googlegroups.com
#29418: rss feed returnes 404
-------------------------------------+-------------------------------------
Reporter: BeshoyFarag | Owner: nobody
Type: Bug | Status: new

Component: contrib.syndication | Version: 2.0
Severity: Normal | Resolution:
Keywords: 404 , rss ,atom | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by BeshoyFarag):

* Attachment "urls.py" added.

url.py

Django

unread,
May 19, 2018, 4:58:05 PM5/19/18
to django-...@googlegroups.com
#29418: rss feed returnes 404
-------------------------------------+-------------------------------------
Reporter: BeshoyFarag | Owner: nobody
Type: Bug | Status: new

Component: contrib.syndication | Version: 2.0
Severity: Normal | Resolution:
Keywords: 404 , rss ,atom | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by BeshoyFarag):

* Attachment "models.py" added.

blog models.py

Django

unread,
May 19, 2018, 4:59:31 PM5/19/18
to django-...@googlegroups.com
#29418: rss feed returnes 404
-------------------------------------+-------------------------------------
Reporter: BeshoyFarag | Owner: nobody
Type: Bug | Status: new

Component: contrib.syndication | Version: 2.0
Severity: Normal | Resolution:
Keywords: 404 , rss ,atom | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by BeshoyFarag:

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>

Django

unread,
May 19, 2018, 7:00:01 PM5/19/18
to django-...@googlegroups.com
#29418: rss feed returnes 404
-------------------------------------+-------------------------------------
Reporter: BeshoyFarag | Owner: nobody
Type: Bug | Status: closed
Component: contrib.syndication | Version: 2.0
Severity: Normal | Resolution: invalid

Keywords: 404 , rss ,atom | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* 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>

Reply all
Reply to author
Forward
0 new messages