Hay, I have come to a point where i need to pass certain variables to all my views (mostly custom authentication type variables).
I was told writing my own context processor was the best way to do this, but i am having some issues.
My settings file looks like this
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.contrib.messages.context_processors.messages",
"sandbox.context_processors.say_hello",
)
As you can see i have a module called 'context_processors' and a function within that called 'say_hello'.
This looks like
def say_hello(request):
return {
'say_hello':"Hello",
}
Am i right to assume i can now do this within my views
{{ say_hello }}
because it doesn't return anything.
My view look like
from django.shortcuts import *
def test(request):
return render_to_response("test.html")