title: how to include urlpatterns in django?
body: <p>In my project I have one app which have its own urls.py like this </p>
  
  <pre><code>urlpatterns = patterns('',
  (r'^(?P&lt;language&gt;\w+)/$', 'MainSite.views.home_page'),)
  </code></pre>
  
  <p>(above file is in my application )</p>
  
  <p>I am trying include this file in main(project's) urls.py
  like this :</p>
  
  <pre><code>from django.contrib import admin
  admin.autodiscover()
  
  urlpatterns = patterns('',
      (r'', include('myproject.MainSite.urls')),
      url(r'^admin/', include(admin.site.urls)),
  )
  
  if settings.DEBUG :
      urlpatterns += patterns('',
          (r'^media/(?P&lt;path&gt;.*)$', 'django.views.static.serve', 
  {'document_root': settings.MEDIA_ROOT}),
          )
  </code></pre>
  
  <p>but after this I can able to call the MainSite's (app's) view but my admin url is not working 
  I tried </p>
  
  <pre><code>urlpatterns = patterns('',
          (r'^$', include('myproject.MainSite.urls')),
          url(r'^admin/', include(admin.site.urls)),
      )
  </code></pre>
  
  <p>but after this this makes admin work but my app's view won't get called,
  how do I solve this.</p>