title: Django user authentication not working
body: <p>I'm using the default model User from django (since I'm using django-facebook) and the user authentication does not work in the template. Here is the code:</p>
  
  <pre><code>{% if request.user.is_authenticated %}
     Welcome, {{ request.user.first_name }}
     &lt;a href="/logout"&gt;logout&lt;/a&gt;
  {% else %}
     &lt;form action="{% url facebook_connect %}?facebook_login=1" method="post"&gt;
          &lt;a href="javascript:void(0);" style="font-size: 20px;" onclick="F.connect(this.parentNode);"&gt;
               &lt;img src="/media/images/site/facebook_login.png" alt="facebook_login" class="facebook_login_button"/&gt;
          &lt;/a&gt;
          &lt;input type="hidden" value="{{ request.path }}" name="next" /&gt;
     &lt;/form&gt;
  {% endif %}
  </code></pre>
  
  <p>I've passed the context_instance from the view:</p>
  
  <pre><code>return render_to_response('index.html', context, context_instance=RequestContext(request))
  </code></pre>
  
  <p>But still it won't work. Thanks for your help!</p>
  
  <p>EDIT:</p>
  
  <p>The user successfully logs in with django-facebook (inserted into auth_user table) and his data is shown but when the user logs out his data disappears and the login form as seen on the edited code above is not show!</p>
  
  <p>Here is the complete view I use for logging in and out the user:</p>
  
  <pre><code>def logout_view(request):
      logout(request)
      return HttpResponseRedirect('/')
  
  def signin(request):
      username = request.POST['username']
      password = request.POST['password']
      user = authenticate(username=username, password=password)
      if user is not None:
          if user.is_active:
              login(request, user)
              return HttpResponseRedirect('/')
          else:
              # TO RETURN ERROR
              return HttpResponseRedirect('/')
      else:
          # TO RETURN ERROR
          return HttpResponseRedirect('/')
  </code></pre>
  
  <p>If I remove the request from request.user.first_name an error appears:</p>
  
  <blockquote>
    <p>You need to set AUTH_PROFILE_MODULE in your project settings</p>
  </blockquote>
  
  <p>That is about all the details I can get.. </p>