title: why is showing '<groups' with the symbol '<' in NoReverseMatch at /groups/
body: <p>When i type <a href="http://127.0.0.1:8000/groups/" rel="nofollow noreferrer">http://127.0.0.1:8000/groups/</a> to the browser, I get NoReverseMatch at /groups/ and'
  
  <p><a href="https://i.stack.imgur.com/w9ZQe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w9ZQe.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>Environment:</p>
    
    <p>Request Method: GET Request URL: <a href="http://127.0.0.1:8000/groups/" rel="nofollow noreferrer">http://127.0.0.1:8000/groups/</a></p>
    
    <p>Django Version: 2.2.5 Python Version: 3.8.0 Installed Applications:
    ['groups',  'django.contrib.admin',  'django.contrib.auth', 
    'django.contrib.contenttypes',  'django.contrib.sessions', 
    'django.contrib.messages',  'django.contrib.staticfiles', 
    'bootstrap3',  'accounts',  'posts'] Installed Middleware:
    ['django.middleware.security.SecurityMiddleware', 
    'django.contrib.sessions.middleware.SessionMiddleware', 
    'django.middleware.common.CommonMiddleware', 
    'django.middleware.csrf.CsrfViewMiddleware', 
    'django.contrib.auth.middleware.AuthenticationMiddleware', 
    'django.contrib.messages.middleware.MessageMiddleware', 
    'django.middleware.clickjacking.XFrameOptionsMiddleware']</p>
    
    <p>Template error: In template
    C:\Users\User\Desktop\fullstack\django\simplesocialatom\simplesocial\templates\base.html,
    error at line 12    '    4 :       5
    :         6 :     Star Social<br>
    7 :     8 :         9 :<br>
        10 :     11 :      
    12 :         13 :     14 :         15 :         16 :     17 :         18 :         19 :     20 :         21 :<br>
        22 : </p>
    
    <p>Traceback:</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\urls\base.py"
    in reverse
      75.                 extra, resolver = resolver.namespace_dict[ns]</p>
    
    <p>During handling of the above exception ('
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\core\handlers\exception.py"
    in inner
      34.             response = get_response(request)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\core\handlers\base.py"
    in _get_response
      145.                 response = self.process_exception_by_middleware(e, request)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\core\handlers\base.py"
    in _get_response
      143.                 response = response.render()</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\response.py"
    in render
      106.             self.content = self.rendered_content</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\response.py"
    in rendered_content
      83.         content = template.render(context, self._request)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\backends\django.py"
    in render
      61.             return self.template.render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in render
      171.                     return self._render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in _render
      163.         return self.nodelist.render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in render
      937.                 bit = node.render_annotated(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in render_annotated
      904.             return self.render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\loader_tags.py"
    in render
      150.             return compiled_parent._render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in _render
      163.         return self.nodelist.render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in render
      937.                 bit = node.render_annotated(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in render_annotated
      904.             return self.render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\loader_tags.py"
    in render
      150.             return compiled_parent._render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in _render
      163.         return self.nodelist.render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in render
      937.                 bit = node.render_annotated(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in render_annotated
      904.             return self.render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\loader_tags.py"
    in render
      62.                 result = block.nodelist.render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in render
      937.                 bit = node.render_annotated(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in render_annotated
      904.             return self.render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\loader_tags.py"
    in render
      62.                 result = block.nodelist.render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in render
      937.                 bit = node.render_annotated(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in render_annotated
      904.             return self.render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\defaulttags.py"
    in render
      309.                 return nodelist.render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in render
      937.                 bit = node.render_annotated(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\base.py"
    in render_annotated
      904.             return self.render(context)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\template\defaulttags.py"
    in render
      443.             url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app)</p>
    
    <p>File
    "C:\Users\User\Anaconda3\envs\simplesocialenv\lib\site-packages\django\urls\base.py"
    in reverse
      86.                     raise NoReverseMatch("%s is not a registered namespace" % key)</p>
    
    <p>Exception Type: NoReverseMatch at /groups/ Exception Value: '
  </blockquote>
  
  <p>And here is my related source code:</p>
  
  <p>project.urls.py</p>
  
  <pre><code>from django.contrib import admin
  from django.urls import path, include
  from . import views
  
  
  urlpatterns = [
      path('accounts/', include('accounts.urls', namespace='accounts')),
      path('groups/', include('groups.urls', namespace='groups')),
      path('accounts/', include('django.contrib.auth.urls')),
      path('admin/', admin.site.urls),
      path('', views.HomePage.as_view(), name='home'),
      path('test/', views.TestPage.as_view(), name='test'),
      path('thanks/', views.ThanksPage.as_view(), name='thanks'),
      path('posts/', include('posts.urls'), name='posts'),
  ]
  </code></pre>
  
  <p>projects settings.py file</p>
  
  <pre><code>INSTALLED_APPS = [
      'groups',
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'bootstrap3',
      'accounts',
      'posts',
  ]
  </code></pre>
  
  <p>groups.urls.py file</p>
  
  <pre><code># GROUPS URLS.PY
  from django.urls import path, include, re_path
  from . import views
  
  app_name = 'groups'
  
  urlpatterns = [
      path('', views.ListGroups.as_view(), name='all'),
      path('new/', views.CreateGroup.as_view(), name='create'),
      # re_path(r'posts/in/(?P&lt;slug&gt;[-\w]+)/$', views.SingleGroup.as_view(), name='single'),
      path('posts/in/&lt;slug:slug&gt;/', views.SingleGroup.as_view(), name='single'),
      path('join/&lt;slug&gt;/', views.JoinGroup.as_view(), name='join'),
      path('leave/&lt;slug&gt;/', views.JoinGroup.as_view(), name='leave')
  ]
  </code></pre>
  
  <p>groups/views.py file</p>
  
  <pre><code>from django.shortcuts import render, get_object_or_404
  from django.contrib.auth.mixins import (LoginRequiredMixin,
                                          PermissionRequiredMixin)
  from django.contrib import messages
  from django.urls import reverse
  from django.views import generic
  from groups.models import Group, GroupMember
  
  class CreateGroup(LoginRequiredMixin, generic.CreateView):
      fields = ('name', 'description')
      model = Group
  
  class SingleGroup(generic.DetailView):
      model = Group
  
  class ListGroups(generic.ListView):
      model = Group
  
  
  class JoinGroup(LoginRequiredMixin, generic.RedirectView):
  
      def get_redirect_url(self, *args, **kwargs):
          return reverse('groups:single', kwargs={'slug':self.kwargs.get('slug')})
  
      def get(self, request, *args, **kwargs):
          group = get_object_or_404(Group, slug=self.kwargs.get('slug'))
  
          try:
              GroupMember.objects.create(user=self.request.user, group=group)
          except IntegrityError:
              messages.warning(self.request, ('Warning already a member'))
          else:
              messages.success(self.request, ('You are now a member'))
          return super().get(request, *args, **kwargs)
  
  class LeaveGroup(LoginRequiredMixin, generic.RedirectView):
  
      def get_redirect_url(self, *args, **kwargs):
          return reverse('groups:single', kwargs={'slug':self.kwargs.get('slug')})
  
      def get(self, request, *args, **kwargs):
          try:
              membership = models.GroupMember.objects.filter(
              user=self.request.user,
              group__slug=self.kwargs.get('slug')
              ).get()
          except models.GroupMember.DoesNotExist:
              messages.warning(self.request, 'sorry you are not in this group')
          else:
              membership.delete()
              messages.success(self.request, 'You have left the group')
              return super().get(request, *args, *kwargs)
  </code></pre>