title: Django Create multiple views
body: <p>I am new to Django. I have to create multiple views and create buttons for them in the main page. I have created different view for different filters of the table. I now have to create buttons in main page to redirect to different views . Can't figure the changes in urls.py and templates.</p>
  <p><strong>here is my code :</strong></p>
  <p><strong><code>views.py</code></strong></p>
  <pre><code>from django_tables2 import SingleTableView
  from django.db.models import Max
  from django.db.models import Min
  from .models import airdata
  from .tables import AirdataTable
  
  
  class AirdataListView(SingleTableView):
      model = airdata
      table_class = AirdataTable
      template_name = 'dashboard/data.html'
      q = airdata.objects.aggregate(alpha=Min('pol_max'))['alpha']
      queryset = airdata.objects.filter(pol_min= q).order_by('-state')
  
  class AirdataListView2(SingleTableView):
      model = airdata
      table_class = AirdataTable
      template_name = 'dashboard/data2.html'
      q = airdata.objects.aggregate(alpha=Max('pol_max'))['alpha']
      queryset = airdata.objects.filter(pol_min= q).order_by('-state')
  </code></pre>
  <p><strong><code>app/urls.py</code></strong></p>
  <pre><code>from django.urls import path
  from . import views
  from .views import AirdataListView,AirdataListView2
  
  urlpatterns = [
      path('page1/', AirdataListView2.as_view()),
      path('page2/', AirdataListView.as_view()),
  ]
  </code></pre>
  <p><strong><code>project/urls.py</code></strong></p>
  <pre><code>from django.contrib import admin
  from django.urls import include, path
  
  urlpatterns = [
      path('dashboard/', include('dashboard.urls')),
      path('admin/', admin.site.urls),
  ]
  </code></pre>
  <p><strong><code>template</code></strong></p>
  <pre><code>  {% load render_table from django_tables2 %}
    &lt;!doctype html&gt;
    &lt;html&gt;
        &lt;head&gt;
            &lt;title&gt;Air Data&lt;/title&gt;
            &lt;link rel=&quot;stylesheet&quot; 
    href=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css&quot; /&gt;
        &lt;/head&gt;
        &lt;body&gt;
            {% render_table table %}
        &lt;/body&gt;
    &lt;/html&gt;
  </code></pre>