Bobby Roberts wrote:
> Hi.  I have a project with one template only.  I am trying to get a
> random quote from the database pushed up to the template so that a new
> quote is shown with each new page url or each page refresh.  Can
> someone point out in the docs where this is covered or help me
> understand the urls.py structure to do this?
>   
This surely doesn't have anything to do with your URLconf - the
randomness has to be inserted in your view, since (I am presuming) you
would like the same URL to show a different quote on separate loads.

I do the same thing with books on holdenweb.com (though in fact this is
done in a context manager, not in the view itself, since it is common to
all pages).

Is your problem the mechanics of *making* the random choice, or are you
uncertain how to get it into your output?

regards
 Steve


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to