title: How can I redirect to a view with a parameter?
body: <p>I'm trying to follow the instructinons for <a href="http://docs.djangoproject.com/en/dev/topics/http/shortcuts/#redirect" rel="nofollow">redirect</a> in Django. I want to redirect to a page and then redirect back again. Here's my code: </p>
  
  <pre><code>def home(request):
      current_user = None
      if 'user_id' in request.session.keys():
          current_user = request.session['user_id']
      else:
          return redirect('update_session_from_ldap', next='home')
  def update_session_from_ldap(request,next):
      remote_user = request.META.get('REMOTE_USER', None)
      request.session['user_id'] = remote_user
      request.session.set_expiry(0) # Expire with browser session.
      return redirect('home')
  </code></pre>
  
  <p>When I go to the homepage, I get:</p>
  
  <blockquote>
    <p>NoReverseMatch at / Reverse for
    'update_session_from_ldap' with
    arguments '()' and keyword arguments
    '{'next': 'home'}' not found.</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>