title: django admin, extending admin with custom views
body: <p>I would like to request some assistance regarding this matter.</p>
  
  <p>I have followed <a href="https://www.stavros.io/posts/how-to-extend-the-django-admin-site-with-custom/" rel="noreferrer">this</a> guide to add a view to my admin.</p>
  
  <p>I am using the same code that the site has and I'm getting an error:</p>
  
  <p><code>Reverse for 'app_list' with arguments '()' and keyword arguments '{'app_label': 'reports'}' not found.</code></p>
  
  <p>The <code>admin/my_view</code> works fine but if I try to access the other pages in the admin such as the index page I am getting the error</p>
  
  <p>Here's the code:</p>
  
  <pre><code>#someapp/admin.py
  
  from django.conf.urls import patterns
  from django.contrib import admin
  from django.http import HttpResponse
  
  def my_view(request):
      return HttpResponse("Hello!")
  
  def get_admin_urls(urls):
      def get_urls():
          my_urls = patterns('',
              (r'^my_view/$', admin.site.admin_view(my_view))
           )
          return my_urls + urls
      return get_urls
  
  admin_urls = get_admin_urls(admin.site.get_urls())
  admin.site.get_urls = admin_urls
  </code></pre>
  
  <p>I am using django 1.8.2, python 2.7</p>
  
  <p>also, what is the best way to add some view or context in the admin's index page?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I have tried  Antoine Pinsard's answer and tried this:</p>
  
  <pre><code>#admin.py
  from django.contrib.admin import AdminSite
  class MyAdminSite(AdminSite):
  
      def get_urls(self):
          from django.conf.urls import url
          urls = super(MyAdminSite, self).get_urls()
          urls += [
              url(r'^my_view/$', self.admin_view(self.my_view))
          ]
          return urls
  
      def my_view(self, request):
          return HttpResponse("Hello!")
  
  admin_site = MyAdminSite()
  </code></pre>
  
  <p>And replacing urls.py's <code>url(r'^admin/', include(admin.site.urls)),</code> to <code>url(r'^admin/', include(admin_site.urls)),</code></p>
  
  <p>and getting:</p>
  
  <p><code>Reverse for 'app_list' with arguments '()' and keyword arguments</code></p>
  
  <p>TRACEBACK:</p>
  
  <pre><code>Request Method: GET
  Request URL: http://localhost:8000/@dmin/
  
  Django Version: 1.8.2
  Python Version: 2.7.10
  Installed Applications:
  ('grappelli',
   'django.contrib.admin',
   'django.contrib.auth',
   'django.contrib.contenttypes',
   'django.contrib.sessions',
   'django.contrib.messages',
   'django.contrib.staticfiles',
   'django.contrib.sessions.models',
   'frontend',
   'file_maintenance',
   'reports',
   'transactions',
   'admin_reorder',
   'admin_notifications',
   'django_twilio',
   'daterange_filter')
  Installed Middleware:
  ('django.contrib.sessions.middleware.SessionMiddleware',
   'django.contrib.auth.models.User',
   'django.middleware.common.CommonMiddleware',
   'django.middleware.csrf.CsrfViewMiddleware',
   'django.contrib.auth.middleware.AuthenticationMiddleware',
   'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
   'django.contrib.messages.middleware.MessageMiddleware',
   'django.middleware.clickjacking.XFrameOptionsMiddleware',
   'django.middleware.security.SecurityMiddleware',
   'admin_reorder.middleware.ModelAdminReorder')
  
  
  Traceback:
  File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in get_response
    157.                     response = middleware_method(request, response)
  File "C:\Python27\lib\site-packages\admin_reorder\middleware.py" in process_template_response
    134.         self.init_config(request, app_list)
  File "C:\Python27\lib\site-packages\admin_reorder\middleware.py" in init_config
    21.         admin_index = admin.site.index(request)
  File "C:\Python27\lib\site-packages\django\views\decorators\cache.py" in _wrapped_view_func
    57.         response = view_func(request, *args, **kwargs)
  File "C:\Python27\lib\site-packages\django\contrib\admin\sites.py" in index
    438.                                 current_app=self.name,
  File "C:\Python27\lib\site-packages\django\core\urlresolvers.py" in reverse
    579.     return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))
  File "C:\Python27\lib\site-packages\django\core\urlresolvers.py" in _reverse_with_prefix
    496.                              (lookup_view_s, args, kwargs, len(patterns), patterns))
  
  Exception Type: NoReverseMatch at /@dmin/
  Exception Value: Reverse for 'app_list' with arguments '()' and keyword arguments '{'app_label': 'django_twilio'}' not found. 0 pattern(s) tried: []
  </code></pre>