title: Django Rest Framework - main url HTTP/1.1" 404 Not Found
body: <p>I have in my project in the main <code>urls.py</code> file the following:</p>
  
  <pre><code># REST Framework packages
  from rest_framework import routers
  router = routers.DefaultRouter()
  
  # ... My viewsets serialized
  router.register(r'users', UserViewSet) 
  # ... Another viewsets 
  urlpatterns = [
  
      url(r'^$', HomeView.as_view(), name='home'),
      # Home url in my project        
  
      url(r'^', include('userprofiles.urls')),
      # Call the userprofiles/urls.py application
  
      url(r'^pacientes/',  include('userprofiles.urls', namespace='pacientes')),
      # Patients url
  
      url(r'^api/', include(router.urls)),
      url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
      # Rest frameworks urls
  ]
  </code></pre>
  
  <p>Until here, when I type in my browser calling to my local server <code>http://localhost:8000/api/</code> I get this like response:</p>
  
  <pre><code>[08/Dec/2016 16:39:42] "GET /api/ HTTP/1.1" 200 7084
  </code></pre>
  
  <p>And my REST <code>url's</code> serialized models appear</p>
  
  <p>After, I've created one url additional in the <code>userprofiles/urls.py</code> application with some regular expression of this way:</p>
  
  <pre><code>from .views import PatientDetail
  urlpatterns = [
      url(r'^(?P&lt;slug&gt;[\w\-]+)/$', PatientDetail.as_view(), name='patient_detail'),
  
  ]
  </code></pre>
  
  <p>And, when I go to <code>http://localhost:8000/api/</code> I get this response:</p>
  
  <pre><code>Not Found: /api/
  [08/Dec/2016 16:42:26] "GET /api/ HTTP/1.1" 404 1753
  </code></pre>
  
  <p>My rest frameworks url is not found and in my browser, denote that the url   which call to PatientDetailView is the origin of this problem:</p>
  
  <p><a href="https://i.stack.imgur.com/RPp07.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RPp07.png" alt="enter image description here"></a></p>
  
  <p>My PatientDetailView have the following:</p>
  
  <pre><code>class PatientDetail(LoginRequiredMixin, DetailView):
      model = PatientProfile
      template_name = 'patient_detail.html'
      context_object_name = 'patientdetail'
  
      def get_context_data(self, **kwargs):
          context=super(PatientDetail, self).get_context_data(**kwargs)
      # And other actions and validations here in forward ...
  </code></pre>
  
  <p>In my regular expressions defined in <code>userprofiles/urls.py</code> I am doing:</p>
  
  <pre><code>url(r'^(?P&lt;slug&gt;[\w\-]+)/$', PatientDetail.as_view(), name='patient_detail')
  </code></pre>
  
  <p>The model PatientProfile have a slug field (username of patient). I pass this slug in the url.</p>
  
  <p>In addition I want that allow me alphanumerics characters upper and lowercase with the <code>[\w\-]</code> parameter, and allow underscores and hyphen characters and many times.</p>
  
  <p>Is possible that my regular expression may be the origin of the problem?
  What can be happened in relation to my <code>/api</code> django-restframework url be not found?</p>