I would strongly recommend avoiding relying on the 'referer' field for anything like this. It'll be unreliable - what if the user opened the vote page in a new tab? What if the user has referers disabled? Instead, pass the continue URL in to the handler, or have separate URLs based on the origin, or use AJAX, so the user doesn't have to leave the page they voted from in the first place.
-Nick Johnson On Tue, Jan 18, 2011 at 4:52 AM, Zeynel <[email protected]> wrote: > Hi, > > I just added a new page "/hot" to sort by number of votes to articles. > > VoteHandler handles the vote with > > item.vote +=1 > item.put() > self.redirect("/newest") > > but now the new page "/hot" also refers to this VoteHandler. > > After writing the new vote to the database I need to redirect to > either /hot or /newest depending on the referrer. > > I searched the group and stackoverflow > > http://stackoverflow.com/search?page=2&tab=relevance&q=redirect%20google%20app%20engine > but I could not find the answer. > > Can anyone direct me to the right reference? > > Thanks. > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-appengine%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- Nick Johnson, Developer Programs Engineer, App Engine Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number: 368047 -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
