title: Django-rest-framework: how to register route for a ViewSet in another app (same project)?
body: <p>Django-rest-frameworks (both tutorial and documentation) indicates to register routes as prefix-ViewSet pairs like so</p>
  
  <pre><code># rapidsms_tut/rapidsms_tut/urls.py 
  #&gt; (rapidsms_tut = project name)
  #&gt; (rapidsms_tut/rapidsms_tut = main/default app)
  from rest_framework import routers
  from voting import views
  
  router.register(r'choices', voting.ChoiceViewSet) # choices is the url prefix (i.e. /choices/)
  </code></pre>
  
  <p>However I cannot find a way out of the following error (I'm making modifications to the rapidsms tutorial I've followed, but it doesn't really matter):</p>
  
  <pre><code>NameError at /choices
  name 'voting' is not defined
  /.../rapidsms_tut/rapidsms_tut/urls.py in &lt;module&gt;, line 12
  </code></pre>
  
  <p>My directory structure is as follows:</p>
  
  <pre><code>rapidsms_tut
     rapidsms_tut
        ...
        urls.py
     voting
        ...
        serializers.py
        models.py # here we have Choice model
        views.py # here we have CHoiceVIewSet ModelViewSet
  </code></pre>
  
  <p><strong>voting/models.py</strong></p>
  
  <pre><code>from django.db import models
  class Choice(models.Model):
      name = models.CharField(max_length=40, unique=True)
      votes = models.IntegerField(default=0)
  </code></pre>
  
  <p><strong>voting/views.py</strong></p>
  
  <pre><code>from .models import Choice
  from rest_framework import viewsets
  from .serializers import ChoiceSerializer
  
  class ChoiceViewSet(viewsets.ModelViewSet):
      queryset = Choice.objects.all()
      serializer_class = ChoiceSerializer
  </code></pre>
  
  <p>I guess the issue has something to do with directory structure / namespaces. Any clue?</p>
  
  <p>Also, by following Django starter tutorial, I've been taught to have the default app (with settings.py, urls.py etc.) as a sub-folder of <em>project folder</em> (e.g. rapidsms_tut as sub-folder of rapidsms_tut).</p>
  
  <p>However I've seen projects around with different apps but with urls.py, settings.py etc <strong>only</strong> in the <strong>root</strong> folder of the project (e.g. in rapidsms_tut and not default app's subfolder). <strong>What's the difference?</strong></p>