title: Django Rest Framework - How to route to a function view
body: <p>I am using <code>Django</code> with <code>Django Rest Framework</code>.</p>
  
  <pre><code>Django==2.0.2
  djangorestframework==3.7.7
  </code></pre>
  
  <p>I am trying to route to a <code>function view</code>.</p>
  
  <p>My current setup looks like this:</p>
  
  <pre><code>- project
      - project
          - urls
      - app
          - urls
          - views
  </code></pre>
  
  <p>In <code>project/urls</code>, I reference the <code>app's</code> urls like this:</p>
  
  <p><code>url(r'^app_api/', include('app_api.urls', namespace='app_api'))</code></p>
  
  <p>In <code>app/urls</code>, I route to the views like this:</p>
  
  <pre><code>router.register(r'', views.app_api, base_name="app_api")
  url(r'', include(router.urls)),
  </code></pre>
  
  <p>In <code>app/views</code> I have defined a function called <code>app_api</code> and decorated it with <code>api_view</code>.</p>
  
  <pre><code>@api_view(['GET'])
  def app_api(request):
  </code></pre>
  
  <p>If I run the server and <code>curl http://localhost:8080/app_api/</code> for example, I get a response with status 200 and a empty JSON. </p>
  
  <p><code>"GET /app_api/ HTTP/1.1" 200 2</code>
  <code>{}</code></p>
  
  <p>I do not understand why this is happening. If I use a class based viewset, it works, but not with a function view.</p>
  
  <p>What is the correct way of routing to a function view when using <code>Django Rest Framework</code>?</p>
  
  <p>Thanks!</p>