title: Calling information from request inside a django template
body: <p>I have a django app using authentication where user's can view one another's profiles.</p>
  
  <p>In my views.py</p>
  
  <pre><code>def display(request, edit=False, pk=None): 
      if not pk:
          pk = request.user.profile.pk
  
      profile = Profile.objects.get(pk=pk)
      d = get_user_info(profile) # returns a dictionary of some info from a user's profile
  
      if edit and request.user == profile.user:
          return render(request, 'edit_profile.html', d)
      else:
          return render(request, 'profile.html', d)
  </code></pre>
  
  <p>Inside my template I would like to give a user the option to click a link allowing them to edit information if they are viewing their own profile. </p>
  
  <pre><code>{% if request.user == profile.user %}
      &lt;a href="{% url "edit_profile" %}"&gt;edit&lt;/a&gt;
  {% endif %}
  </code></pre>
  
  <p>I have two questions about this.<br>
  First: I thought using render() allowed me to access <code>request</code> inside the template. However, that's not working. Am I doing it wrong? Or do I need to explicitly pass <code>render</code> with the dictionary?</p>
  
  <pre><code>d['request']=request    
  return render(request, 'profile.html', d) 
  </code></pre>
  
  <p>Second: Is this okay to do? Or should I be doing this some other way?</p>