title: Django {{ profile }} globally available in templates
body: <p>I'm building app with django-registration and django-profiles. Everywhere on the page I have the section displaying data of currently logged in user (like first and last name, using syntax like: <code>{{ user.first_name }}</code>) and it works fine. It is done with <strong>subpages templates extending the one main template with HTML structure</strong> and the section mentioned.</p>
  
  <p>Now I try to add the user image (using <code>{{ profile.image }}</code>) to the section and there is a problem with availability of <code>{{ profile }}</code> template variable everywhere but on the following the pages:</p>
  
  <ul>
  <li><a href="http://127.0.0.1:8000/profiles/myusername/" rel="nofollow">http://127.0.0.1:8000/profiles/myusername/</a> (where myusername is username of guy with profile photo),</li>
  <li><a href="http://127.0.0.1:8000/profiles/edit/" rel="nofollow">http://127.0.0.1:8000/profiles/edit/</a>.    </li>
  </ul>
  
  <p>In <strong>settings.py</strong> I have:</p>
  
  <pre><code>AUTH_PROFILE_MODULE = 'intranet.UserProfile'
  
  TEMPLATE_CONTEXT_PROCESSORS = (
     'django.core.context_processors.static',
  )
  </code></pre>
  
  <p>Adding <code>"django.contrib.auth.context_processors.auth",</code> to <code>TEMPLATE_CONTEXT_PROCESSORS</code> does not change anything.</p>
  
  <p>My UserProfile class in <strong>models.py</strong> is:</p>
  
  <pre><code>class UserProfile(models.Model):
      user = models.OneToOneField(User)
      image = models.ImageField(upload_to=user_image_name,
          blank=True, null=True, verbose_name='User photo')
  </code></pre>
  
  <p><strong>urls.py</strong>:</p>
  
  <pre><code>(r'^profiles/edit/', 'profiles.views.edit_profile', {'form_class': ProfileForm, }),
  (r'^profiles/', include('profiles.urls')),
  </code></pre>
  
  <p>so the rest is set by default in <strong>django-profiles urls.py</strong> file.</p>
  
  <p>I would like <strong>to be able to use</strong> <code>{{ profile }}</code> <strong>template variable everywhere</strong> (not only on the profile pages) in the templates of the application to make it possible to use it in the main template that is extended by the others.</p>
  
  <p>Please let me know how can I get this. Any help will be very appreciated.</p>
  
  <p>I'm using Django in version 1.3.1, django-registration in version 0.7 and django-profiles in version 0.2.</p>