title: Django: Page Not Found
body: <p>I'm getting a 404 from Django and none of the previous posts on the subject (of which there are many) seem to have helped.</p>
  
  <p>views.py</p>
  
  <pre><code>from django.views.generic.detail import DetailView, SingleObjectMixin
  from app.models import MyModel
  
  class MyDetails(DetailView, SingleObjectMixin):
      template_name = "app/my_view.html"
      model = MyModel
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>from django.conf.urls import include, url
  from django.contrib   import admin
  from app.views import MainList, post_form_upload, MyDetails
  
  urlpatterns = [
      url(r'^$', MainList.as_view(), name="main_list"),
      url(r'^add_something$', post_form_upload, name="add_something"),
      url(r'^my_details/(?P&lt;pk&gt;\d+)$', MyDetails.as_view(), name="my_details"),
  ]
  </code></pre>
  
  <p>app/urls.py</p>
  
  <pre><code>from django.conf.urls  import url
  from django.conf.urls import include, url
  from django.contrib   import admin
  
  urlpatterns = [
      (r'^$', include('app.urls')),
      url(r'^admin/', include(admin.site.urls)),
  ]
  </code></pre>
  
  <p>when I enter the URL: <a href="http://localhost:8000/my_details" rel="nofollow noreferrer">http://localhost:8000/my_details</a>, I get the following error:</p>
  
  <pre><code>Using the URLconf defined in app.urls, Django tried these URL patterns, in this order:
  ^$ [name='main_list']
  ^add_something$ [name='add_something']
  ^my_details/(?P&lt;pk&gt;\d+)$ [name='my_details']
  The current URL, my_details, didn't match any of these.
  </code></pre>
  
  <p>The other two URLs (/ and /add_something) work fine.</p>