Always including the user in the django template context
<p>I am working on a small intranet site for a small company, where user should be able to post. I have imagined a very simple authentication mechanism where people just enter their email address, and gets sent a unique login url, that sets a cookie that will always identify them for future requests.</p>

<p>In my template setup, I have base.html, and the other pages extend this. I want to show logged in or register button in the base.html, but how can I ensure that the necessary variables are always a part of the context? It seems that each view just sets up the context as they like, and there is no global context population. Is there a way of doing this without including the user in each context creation?</p>

<p>Or will I have to make my own custom shortcuts to setup the context properly?</p>

<p>There is <strong>no need</strong> to write a context processor for the user object if you already have the <a href="https://docs.djangoproject.com/en/dev/topics/auth/default/#authentication-data-in-templates"><code>"django.core.context_processors.auth"</code></a> in <a href="https://docs.djangoproject.com/en/dev/ref/settings/#std%3asetting-TEMPLATE_CONTEXT_PROCESSORS"><code>TEMPLATE_CONTEXT_PROCESSORS</code></a> <strong>and</strong> if you're using <a href="https://docs.djangoproject.com/en/dev/ref/templates/api/#subclassing-context-requestcontext"><code>RequestContext</code></a> in your views. </p>

<p>if you are using django 1.4 or latest the module has been moved to <code>django.contrib.auth.context_processors.auth</code></p>
