title: django 'User' object has no attribute 'get' error
body: <p>I am writing an simple django application and got stuck into this error, can some one please help me 
  my views.py looks exactly as</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>def custom_login(request):
      if request.user.is_authenticated():
          return HttpResponseRedirect('dashboards')        
      return login(request, 'login.html', authentication_form=LoginForm)
  
  def custom_logout(request):
      return logout(request, next_page='/')
  
  def user(request):
          context = {'user': user, 'groups': request.user.groups.all(), 'dashboards': Dashboard}
      return render_to_response('registration/dashboards.html', context, context_instance=RequestContext(request))</code></pre>
  </div>
  </div>
  </p>
  
  <p>and my forms.py is like</p>
  
  <pre><code>from django import forms
  from django.contrib.auth.models import User
  from django.forms import ModelForm
  #from mhawk.models import Dashboard
  
  
  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>and the thing is I am trying to display the logged in username in an html page.</p>
  
  <p>here is my trace back of error</p>
  
  <pre><code>Environment:
  
  
  Request Method: POST
  Request URL: http://127.0.0.1:8000/user/
  
  Django Version: 1.7.3
  Python Version: 2.7.3
  Installed Applications:
  ('django.contrib.admin',
   'django.contrib.auth',
   'django.contrib.contenttypes',
   'django.contrib.sessions',
   'django.contrib.messages',
   'django.contrib.staticfiles',
   'mhawk')
  Installed Middleware:
  ('django.contrib.sessions.middleware.SessionMiddleware',
   'django.middleware.common.CommonMiddleware',
   'django.middleware.csrf.CsrfViewMiddleware',
   'django.contrib.auth.middleware.AuthenticationMiddleware',
   'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
   'django.contrib.messages.middleware.MessageMiddleware',
   'django.middleware.clickjacking.XFrameOptionsMiddleware')
  
  
  Traceback:
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
    204.                 response = middleware_method(request, response)
  File "/usr/local/lib/python2.7/dist-packages/django/middleware/clickjacking.py" in process_response
    31.         if response.get('X-Frame-Options', None) is not None:
  
  Exception Type: AttributeError at /user/
  Exception Value: 'User' object has no attribute 'get'
  </code></pre>
  
  <p>urls.py looks like</p>
  
  <pre><code>from django.conf.urls import patterns, include, url
  from django.contrib import admin
  from drinker import views, models
  from django.contrib.auth.models import User
  
  urlpatterns = patterns('',
  
      url(r'^admin/', include(admin.site.urls)),
      url(r'^login/$', 'django.contrib.auth.views.login',),
      url(r'^logout/$', 'django.contrib.auth.views.logout'),
      url(r'^user/$', 'mhawk.views.User'),
  )
  </code></pre>
  
  <p>dashboards.html:-</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>{% extends "base.html" %}
  {% block content %}
  {% 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 %}
  
  &lt;ul&gt;
  {% for group in groups %}
      &lt;li&gt;
          &lt;strong&gt;{{ group.name }}&lt;strong&gt; -
          
              {{ dashboards.d_name }}{% if not forloop.last %},{% endif %}
          
      &lt;/li&gt;
  {% endfor %}
  &lt;/ul&gt;
  
  
  
  {% endblock %}</code></pre>
  </div>
  </div>
  </p>