Hi,
Can you please help me integrate this script into my osqa? I already tried but failed... so please...
what I did so far:
(I want to display random quote in the header of osqa)
so...
header.html ->>
{{ random_quote }}
forum/views/randomquotes.py ->>
import random
def random_quotes (request,
template_name='header.html'):
quotes = [""There are always two people in every picture: the
photographer and the viewer."",
""My portraits are more about me than they are about the
people I photograph."
~ Richard
Avedon"]
pick_quote = quotes[random.randint(0, len(quotes) -
1)]
return render(request, template_name, {
'random_quote': pick_quote,
})
forum/urls.py ->>
url(r'^$', app.randomquotes.random_quotes, name='random_quotes'),
Can you please help me? why doesn't this work? what am I doing wrong???
asked
15 Jun '11, 15:08
Sandro Dznel...
181●2●8●16
accept rate:
50%