title: Redirect to index page after submiting form in django
body: <p>Everything works correctly apart from redirecting back to the index page after adding the products data, currently after my data gets save it gets redirected to <strong>127.0.0.1:8000/product/add_product/add_product</strong></p>
  
  <p>Currently when my index page(add_product.html) loads, I have a table that renders data from the database,</p>
  
  <ol>
  <li>first my url looks like >> <strong>127.0.0.1:8000/product/</strong> </li>
  <li>Then once I hit the add button url changes to <strong>127.0.0.1:8000/product/add_product/</strong> , no problem there, but</li>
  <li>when i try to add data again my url goes to <strong>127.0.0.1:8000/product/add_product/add_product</strong> and i get a Page not found error</li>
  </ol>
  
  <p>My views.py</p>
  
  <pre><code>from models import Product,Category
  from django.shortcuts import render_to_response,get_object_or_404
  from django.http import HttpResponseRedirect
  
  def index(request):
      category_list = Category.objects.all()
      product_list = Product.objects.all()
      return render_to_response('product/add_product.html', {'category_list': category_list, 'product_list':product_list})
  
  def add_product(request):
      post = request.POST.copy()
  
      category = Category.objects.get(name=post['category'])
      product = post['product']
      quantity = post['quantity']
      price = post['price']
  
      new_product = Product(category = category, product = product, quantity = quantity, price = price )
      new_product.save()
      category_list = Category.objects.all()
      product_list = Product.objects.all()
      return render_to_response('product/add_product.html', {'category_list': category_list, 'product_list':product_list})
  </code></pre>
  
  <p>My urls.py</p>
  
  <pre><code>from django.conf.urls.defaults import patterns, include, url
  
  urlpatterns = patterns('product.views',
      url(r'^$', 'index'),                       
      url(r'^add_product/$', 'add_product'),
  )
  </code></pre>
  
  <p>How do i get the URL pointing back to my index page(add_product.html) ?</p>