I did it like this on economy-chat.com

first.. every link to the feed itself is unique, based on User-ID or session key.
i have the following in my urls.py

  (r'^feed/atom/(?P<content_type_id>\d+)/(?P<user_id>\d+)/(?P<hash>.+)/$', 'atomfeed'),
  (r'^feed/atom/(?P<session_key>\w+)/$', 'atomfeed'),
  
and the atomfeed view itself is

def atomfeed(request,  content_type_id=None, user_id=None, hash=None, session_key=None ):
    if content_type_id is not None and verify_objref_hash( content_type_id, user_id, hash ):
        try:
            request.user = User.objects.get(pk=user_id)
        except (KeyError, User.DoesNotExist):
            pass
    else:
        if session_key:
            try:
                request.session = Session.objects.get(pk=session_key )
            except (KeyError, Session.DoesNotExist):
                pass

    return buildfeed(request, feedgenerator.Atom1Feed, tag, author)

(where buildfeed would actually generate the XML feed (ala what feedjack http://tabo.aurealsys.com/software/feedjack/ does)

which sets up the session/userid for the rest of the request.

naturally I have the RSS feeds generate the appropriate link on the page in question


for example
<link rel="alternate" type="application/atom+xml" title="Economy Chat: Most recent posts" href="" />
or
<link rel="alternate" type="application/atom+xml" title="Economy Chat: Most recent posts" href="" />




On 22/07/2006, at 4:25 PM, afarnham wrote:


I am messing with feeds for the first time with Django and was
wondering if there is anyway to do authentication (i.e. grab the
session) from inside the my Feed class? I followed the high level
framework example from the documentation page if that helps in
understanding how I implemented this feed.

Thanks,

Aaron Farnham

--
Ian Holsman
join http://gyspsyjobs.com the marketplace for django developers 



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

Reply via email to