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%20Dzneladze's gravatar image

Sandro Dznel...
1812816
accept rate: 50%

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×25
×24
×2

Asked: 15 Jun '11, 15:08

Seen: 340 times

Last updated: 15 Jun '11, 15:08

powered by OSQA