title: How to configure Django views and urls to render specific templates
body: <p>When I bring up 127.0.0.1:8000, the current page that show up is <code>something.html</code> template.</p>
  
  <p>I would need to make it appear index.html at first launch, then when I click on other parts,it should go to 127.0.0.1:8000/something.html (or 127.0.0.1:8000/myapp/something.html). </p>
  
  <p><strong>What would be the structure to achieve this?</strong><br>
  I frequently get error message : <code>The current URL didn't match any of these.</code> </p>
  
  <p>Currently, my structure is</p>
  
  <pre><code>project
       ---myapp
            ---admin.py
            ---models.py
            ---url.py
            ---views.py
       ---static
       ---templates
            ---myapp
               ---html files
       ---mysite
            ---settings.py
            --- url.py
  </code></pre>
  
  <p>under my settings.py</p>
  
  <pre><code>STATIC_URL = '/static/'
  STATIC_ROOT = os.path.join(BASE_DIR, 'static')
  </code></pre>
  
  <p>under mysettings/url.py </p>
  
  <pre><code>   urlpatterns = [
          # Examples:
          url(r'^$', 'mysite.views.home', name='home'),
          url(r'^myapp/', include('myapp.urls')),
          url(r'^admin/', include(admin.site.urls)),
      ]
  </code></pre>
  
  <p>mysite/urls.py</p>
  
  <pre><code>from django.conf.urls import include, url
  from django.contrib import admin
  from django.conf.urls import patterns
  from django.views.generic import TemplateView
  
  
  urlpatterns = [
      # Examples:
      url(r'^', include('myapp.urls')),
      url(r'^admin/', include(admin.site.urls)),
  ]
  
  
  admin.site.site_header = 'Admin'
  </code></pre>
  
  <p>myapp/url.py</p>
  
  <pre><code>from . import views
  from django.conf.urls import patterns, include, url
  from django.views.generic import TemplateView
  
  
  urlpatterns = patterns('',
      #brings up something.html when we comment it out. No module found if included.
      #url(r'^$', views.home, name='home'),
      url(r'^$', views.post_list, name='post_list'),
  )
  </code></pre>