RSS Feed

60 views
Skip to first unread message

armagan

unread,
Jun 8, 2012, 7:53:09 AM6/8/12
to Django users
Hi,

I'm trying to implemente an rss to my project. I have done a simple
example in django doc. But I have an error in urls.py.

from 'blogum.feeds import LatestEntriesFeed' ==> I've imported this, I
have an error 'No module named feeds'.

Thanks in advance for any help provided.

Armağan

Diego pascual lopez

unread,
Jun 8, 2012, 8:11:33 AM6/8/12
to django...@googlegroups.com
Hi,

Do you have in your blogum directory a feeds.py?



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.


bruno desthuilliers

unread,
Jun 8, 2012, 8:13:14 AM6/8/12
to Django users
On Jun 8, 1:53 pm, armagan <armagan.er...@gmail.com> wrote:
> Hi,
>
> I'm trying to implemente an rss to my project. I have done a simple
> example in django doc.

Which one ? url, please.

> But I have an error in urls.py.
>
> from 'blogum.feeds import LatestEntriesFeed' ==> I've imported this, I
> have an error  'No module named feeds'.

Is 'blogum' (which I assume it's a django app, iow a python package,
iow a directory with a __init__.py file in it) in your sys.path ? If
yes, is there a file named "feeds.py" in it ?

armagan

unread,
Jun 8, 2012, 8:23:01 AM6/8/12
to Django users
No, I just realized. But I tried import 'from projem.blogum.views
import LatestEntriesFeed' and I've had a 404 error. I guess, i have a
url error.

#My RSS class
class LatestEntriesFeed(Feed):
title = "site news"
link = "/projeler/haberler/"
description = "Updates on changes and additions"

#in urls.py

url(r'^projeler/rss/$', LatestEntriesFeed()),

Have a problem in urls?

My home url http://localhost:8000/projeler/

and rss url http://localhost:8000/projeler/haberler/

Diego pascual lopez

unread,
Jun 8, 2012, 8:45:20 AM6/8/12
to django...@googlegroups.com
On Fri, Jun 8, 2012 at 2:23 PM, armagan <armaga...@gmail.com> wrote:
No, I just realized. But I tried import 'from projem.blogum.views
import LatestEntriesFeed' and I've had a 404 error. I guess, i have a
url error.

#My RSS class
class LatestEntriesFeed(Feed):
   title = "site news"
   link = "/projeler/haberler/"
   description = "Updates on changes and additions"

#in urls.py

url(r'^projeler/rss/$', LatestEntriesFeed()),

I think you should send a function name not a class name in the second parameter. 

you should check https://docs.djangoproject.com/en/dev/topics/http/urls/#url to create patterns in your urls.py and check if you create your app correctly. 

armagan

unread,
Jun 8, 2012, 9:07:47 AM6/8/12
to Django users
I solved the problem. I used application's urls.py not project's
urls.py and update urls like (r'^rss/$', LatestEntriesFeed()).

Thanks for help.


On Jun 8, 3:45 pm, Diego pascual lopez <azoti...@gmail.com> wrote:
> On Fri, Jun 8, 2012 at 2:23 PM, armagan <armagan.er...@gmail.com> wrote:
> > No, I just realized. But I tried import 'from projem.blogum.views
> > import LatestEntriesFeed' and I've had a 404 error. I guess, i have a
> > url error.
>
> > #My RSS class
> > class LatestEntriesFeed(Feed):
> >    title = "site news"
> >    link = "/projeler/haberler/"
> >    description = "Updates on changes and additions"
>
> > #in urls.py
>
> > url(r'^projeler/rss/$', LatestEntriesFeed()),
>
> I think you should send a function name not a class name in the second
> parameter.
>
> you should checkhttps://docs.djangoproject.com/en/dev/topics/http/urls/#urltocreate
> patterns in your urls.py and check if you create your app
> correctly.
>
> do you use startapp toolhttps://docs.djangoproject.com/en/dev/ref/django-admin/#startapp-appn...
>
>
>
>
>
>
>
>
>
> > Have a problem in urls?
>
> > My home urlhttp://localhost:8000/projeler/
>
> > and rss urlhttp://localhost:8000/projeler/haberler/

Diego pascual lopez

unread,
Jun 10, 2012, 12:24:20 PM6/10/12
to django...@googlegroups.com
Great!!!!

you're welcome.
Reply all
Reply to author
Forward
0 new messages