title: url not showing because of middleware file
body: <p>Im trying to access my index view but i' m automatically redirected to show_login view , i think that the problem comes from my custom middleware file</p>
  <p>here is the main view:</p>
  <pre><code>def indexmain(request):
      return render(request, &quot;main_template/index.html&quot;)
  </code></pre>
  <p>Urls :</p>
  <pre><code>     path('admin/', admin.site.urls),
      path('accounts/',include('django.contrib.auth.urls')),
      path('', views.ShowLoginPage, name=&quot;show_login&quot;),
      path('indexmain', views.indexmain,name=&quot;index&quot;),
      path('get_user_details', views.GetUserDetails),
      path('logout_user', views.logout_user,name=&quot;logout&quot;),
      path('doLogin',views.doLogin,name=&quot;do_login&quot;),
  </code></pre>
  <p><strong>here is my custom Middleware file:</strong></p>
  <pre><code>    from django.http import HttpResponseRedirect
  from django.urls import reverse
  from django.utils.deprecation import MiddlewareMixin
  
  
  class LoginCheckMiddleWare(MiddlewareMixin):
  
      def process_view(self,request,view_func,view_args,view_kwargs):
          modulename=view_func.__module__
          print(modulename)
          user=request.user
          if user.is_authenticated:
              if user.user_type == &quot;1&quot;:
                  if modulename == &quot;gestion.HodViews&quot;:
                      pass
                  elif modulename == &quot;gestion.views&quot; or modulename == &quot;django.views.static&quot;:
                      pass
                  elif modulename == &quot;django.contrib.auth.views&quot; or modulename ==&quot;django.contrib.admin.sites&quot;:
                      pass
                  else:
                      return HttpResponseRedirect(reverse(&quot;admin_home&quot;))
              elif user.user_type == &quot;2&quot;:
                  if modulename == &quot;gestion.StaffViews&quot; or modulename == &quot;gestion.EditResultVIewClass&quot;:
                      pass
                  elif modulename == &quot;student_management_app.views&quot; or modulename == &quot;django.views.static&quot;:
                      pass
                  else:
                      return HttpResponseRedirect(reverse(&quot;staff_home&quot;))
  
              else:
                  return HttpResponseRedirect(reverse(&quot;show_login&quot;))
  
          else:
              if request.path == reverse(&quot;index&quot;) or request.path == reverse(&quot;show_login&quot;) or request.path == reverse(&quot;do_login&quot;) or modulename == &quot;django.contrib.auth.views&quot; or modulename ==&quot;django.contrib.admin.sites&quot; :
                  pass
              else:
                  return HttpResponseRedirect(reverse(&quot;show_login&quot;))
  </code></pre>