title: Django and urls.py: How do I HttpResponseRedirect via a named url?
body: <p>I'm writing a member-based web application, and I need to be able to redirect the page after login. I want to use the named url from my urls.py script in my views.py file for the login application, but I can't for the life of me figure out what to do. What I have is this:</p>
  
  <pre><code>def login(request): 
  if request.session.has_key('user'):
      if request.session['user'] is not None:
          return HttpResponseRedirect('/path/to/page.html')
  </code></pre>
  
  <p>What I want to accomplish is something like:</p>
  
  <pre><code>def login(request): 
  if request.session.has_key('user'):
      if request.session['user'] is not None:
          return HttpResponseRedirect url pageName
  </code></pre>
  
  <p>I get syntax errors when I execute this, any ideas?</p>