title: How to include urls with app_name without having to use reverse with app name in Django?
body: <p>I have a custom directory for <code>allauth</code> templates. I need some custom <code>urlpatterns</code> as well as I don't want some default views. I wanted to start with glueing in the entire <code>allauth</code> and change things that I need later on.</p>
  <p>My main app <code>config/urls.py</code> file</p>
  <pre class="lang-py prettyprint-override"><code>from django.urls import include, path
  
  
  urlpatterns = [
      path(&quot;account/&quot;, include(&quot;users.urls&quot;)),
  ]
  </code></pre>
  <p>Users app:</p>
  <p><code>users/urls.py</code></p>
  <pre class="lang-py prettyprint-override"><code>app_name = &quot;users&quot;
  
  urlpatterns = [
      path(&quot;login/&quot;, allauth_views.login, name=&quot;account_login&quot;),
      path(&quot;logout/&quot;, allauth_views.logout, name=&quot;account_logout&quot;),
      path(&quot;signup/&quot;, allauth_views.signup, name=&quot;account_signup&quot;),
  ]
  
  </code></pre>
  <p>With this basic setup, if I go to <code>/account/login</code> it routes correctly to the desired view, but it is defined in <code>users</code> app with the <code>app_name = &quot;users&quot;</code>, therefore, I have to access it in other views with <code>reverse(users:account_login)</code>. The problem is that <code>allauth</code> <code>LoginView</code> has this method</p>
  <pre><code>    def get_context_data(self, **kwargs):
          ret = super(LoginView, self).get_context_data(**kwargs)
          signup_url = passthrough_next_redirect_url(self.request,
                                                     reverse(&quot;account_signup&quot;),
                                                     self.redirect_field_name)
          redirect_field_value = get_request_param(self.request,
                                                   self.redirect_field_name)
          site = get_current_site(self.request)
  
          ret.update({&quot;signup_url&quot;: signup_url,
                      &quot;site&quot;: site,
                      &quot;redirect_field_name&quot;: self.redirect_field_name,
                      &quot;redirect_field_value&quot;: redirect_field_value})
          return ret
  </code></pre>
  <p>which does the lookup on <code>reverse(&quot;account_signup&quot;)</code> but Django gets lost and throws <code>django.urls.exceptions.NoReverseMatch</code>.</p>
  <p>Two solutions:</p>
  <ol>
  <li>If I set those <code>allauth</code> urlpatterns in my main urls file it works correctly but I want to keep this file small and define <code>allauth</code> urls in my <code>users</code> app.</li>
  <li>If I don't define <code>app_name</code> in my <code>users/urls.py</code> it works properly but I want it for other routes. I consider adding <code>app_name</code> to be a good practice. I could have created another app for <code>allauth</code> without an app name but then I'd have users stuff in two apps.</li>
  </ol>
  <p>None of these satisfy me.</p>
  <p>What I want:</p>
  <p>Can I somehow <code>include</code> them without a namespace? I tried <code>path(&quot;account/&quot;, include(&quot;users.urls&quot;, namespace=None))</code> without any luck.</p>