title: In Django, How do you write the url pattern for '/' and other root-based urls
body: <p>I'm new to django, and one of the things that I'm still learning is url_patterns. I set up a pages app to handle the root path (http://www.mysite.com) as well as some static pages such as the about page. I figured out how to set up the url pattern for the root path, but I can't get the site to direct the path '/about' to the pages "about" view.</p>
  
  <p>Here is my main urls.py</p>
  
  <pre><code> from django.conf.urls import patterns, include, url
   from django.conf import settings
   urlpatterns = patterns('',
       url(r'^polls/', include('polls.urls')),
       url(r'^$', 'pages.views.root'),
       url(r'^/', include('pages.urls')),
    )
  </code></pre>
  
  <p>here is my pages urls.py</p>
  
  <pre><code> from django.conf.urls import patterns, include, url
   urlpatterns = patterns('pages.views',
        url(r'^about', 'about'),
   )
  </code></pre>
  
  <p>Here is my pages views.py</p>
  
  <pre><code> # Create your views here.
   from django.shortcuts import render_to_response
   from django.template import RequestContext
   from django.http import HttpResponse, HttpResponseRedirect
   from django.core.urlresolvers import reverse
  
   def root(request):
      return render_to_response('pages/root.html',context_instance=RequestContext(request))
   def about(request):
      return render_to_response('pages/about.html',context_instance=RequestContext(request))
  </code></pre>
  
  <p>If I change the main urls.py file to have <code>r'^a/', include('pages.urls')</code> then the path '/a/about' directs to the about action.. so I think it has to be an issue in the way i'm writing the url pattern in this file. But, I can't figure out how to change it. Can anyone help?</p>