title: How to register DRF router url patterns in django 2
body: <p>My DRF routers specify a namespace so that I can <code>reverse</code> my urls:</p>
  
  <p><strong>urls.py:</strong></p>
  
  <pre><code>router = DefaultRouter()
  router.register('widget/', MyWidgetViewSet, base_name='widgets')
  urlpatterns =+ [
      url(r'/path/to/API/', include(router.urls, namespace='widget-api'),
  ]
  </code></pre>
  
  <p>Which, when upgrading to django 2, gives:</p>
  
  <blockquote>
    <p>django.core.exceptions.ImproperlyConfigured: Specifying a namespace in include() without providing an app_name is not supported. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.</p>
  </blockquote>
  
  <p>Django 2 <a href="https://docs.djangoproject.com/en/2.0/topics/http/urls/#url-namespaces-and-included-urlconfs" rel="noreferrer">now requires</a> <code>app_name</code> if the <code>namespace</code> kwarg is specified when using <code>include</code>. What's the right way to specify <code>app_name</code> when the url patterns are constructed by a DRF url router? I don't think <a href="http://www.django-rest-framework.org/api-guide/routers/#using-include-with-routers" rel="noreferrer">the documentation</a> is up-to-date for django 2 on this subject.</p>