title: how to get group name using User in django
body: <p>I am stuck in django's group module can any one tell me how to solve it.
  my problem is now i'm dispalying the username of the logged-in user, i want to display group-name and the profiles present in that group along with the username.and my views are like this,</p>
  
  <pre><code>def user(request):
      context = {'user': request.user}
      return render_to_response('username.html', context,
                                context_instance=RequestContext(request))
  </code></pre>
  
  <p>now what do I need to add in order to achieve my requirement</p>
  
  <p>forms.py</p>
  
  <pre><code>class LoginForm(forms.Form):
          username = forms.CharField(label=(u'User Name'))
          password = forms.CharField(label=(u'Password'),
                                  widget=forms.PasswordInput(render_value=False))
  </code></pre>
  
  <p>username.html is</p>
  
  <pre><code>{% if user.is_authenticated %}
      &lt;p&gt;Welcome, {{ request.user.get_username }}. &lt;br/&gt;
  {% else %}
      &lt;p&gt;Welcome, new user. Please log in.&lt;/p&gt;
  {% endif %}
  </code></pre>
  
  <p>heres my model.py</p>
  
  <pre><code>class userprofile(models.Model):
      u_name = models.CharField(max_length=200)
      u_description = models.CharField(max_length=200)
      u_url = models.CharField(max_length=200)
      u_status = models.CharField(max_length=200)
      owner = models.ForeignKey(Group)
  
      def __str__(self):return self.u_name
  </code></pre>