title: Django response redirect on variable url
body: <p>I'm on a page with a variable url <code>/emails/edit/32/</code>, and I want to update the form and refresh the page...how do I issue an HttpResponseRedirect to the current page, which has a variable extension? </p>
  
  <p>My urls.py is: </p>
  
  <pre><code>urlpatterns = patterns('',
      (r'^emails/edit/$', 'email_edit'),    # this is the page it is re-directing to
      (r'^emails/edit/(?P&lt;email_id&gt;\d+)/$', 'emails_single'),
  )
  </code></pre>
  
  <p>And my views.py is:             </p>
  
  <pre><code>def emails_single(request, email_id):
      ...(stuff)...
      Email.objects.filter(id=request.POST['id']).update(email=request.POST['email'])
          return HttpResponseRedirect(reverse('emails_single',args=[email_id]))
  </code></pre>
  
  <p>Update: what it is doing is just chopping off the ending of the URL (even when using the reverse examples). For example: <a href="http://127.0.0.1:8000/emails/edit/42/" rel="nofollow">http://127.0.0.1:8000/emails/edit/42/</a> --> <a href="http://127.0.0.1:8000/emails/edit/" rel="nofollow">http://127.0.0.1:8000/emails/edit/</a></p>