Flatpages use RequestContext
in rendering templates. Here's a bit more about RequestContext. Suffice to say, you should be able to write a Context Processor to add request.user to the context of every template. Something like this:
def user(request):
"""A context processor that adds the user to template context"""
return {
'user': request.user
}
Which you would then add to your existing TEMPLATE_CONTEXT_PROCESSORS
in settings.py:
TEMPLATE_CONTEXT_PROCESSORS = TEMPLATE_CONTEXT_PROCESSORS + (
'context_processors.user',
)
You just need to make sure all your views bind RequestContext
to their templates as well:
return render_to_response('my_template.html',
my_data_dictionary,
context_instance=RequestContext(request))
Here's a good read on Context Processors. They're a very helpful feature.