title: Django Rest Framework: How to set authentication in `urls.py`?
body: <p>I'm developing a REST API using the Django Rest Framework.</p>
  <p>For authentication, I use,</p>
  <ul>
  <li><a href="https://github.com/SimpleJWT/django-rest-framework-simplejwt" rel="nofollow noreferrer">django-rest-framework-simplejwt</a></li>
  <li><a href="https://github.com/jazzband/dj-rest-auth" rel="nofollow noreferrer">dj-rest-auth</a></li>
  </ul>
  <p>I now know how to set up auth for a specific view of an endpoint.
  But I couldn't find a way of setting a URL pattern protected.</p>
  <p>For example, I have two apps named <code>an_app</code> and <code>another_app</code>.
  Here's my project's <code>urls.py</code> file.</p>
  <pre class="lang-py prettyprint-override"><code>from django.conf.urls import url
  from django.urls import path, include
  
  
  urlpatterns = [
      path('auth/', include('dj_rest_auth.urls')),
      path('auth/signup/', include('dj_rest_auth.registration.urls')),
  
      path('public_contents/', include('an_app.urls')),
      path('private_contents/', include('another_app.urls')),
  ]
  </code></pre>
  <p>The two URLs - <code>public_contents</code> and <code>private_contents</code> are both accessible without authenication.
  I want to make the <code>public_contents</code> accessible by anybody, and want to make the <code>private_contents</code> accessible by the user who has a valid JWT token.</p>
  <p>How can I do it?</p>