diff --git a/courses/templates/category/index.html b/courses/templates/category/index.html
index a308a77..4b0dfcd 100644
--- a/courses/templates/category/index.html
+++ b/courses/templates/category/index.html
@@ -94,6 +94,27 @@
{% endfor %}
{% endif %}
+
+
+
{% endblock %}
\ No newline at end of file
diff --git a/courses/views.py b/courses/views.py
index a45a6f5..6eed274 100644
--- a/courses/views.py
+++ b/courses/views.py
@@ -303,6 +303,24 @@ class IndexCatView(LoginRequiredMixin, generic.ListView):
queryset = CourseCategory.objects.all()
template_name = 'category/index.html'
context_object_name = 'categories'
+ paginate_by = 5
+
+ def get_context_data(self, **kwargs):
+ context = super(IndexCatView, self).get_context_data(**kwargs)
+ list_cat = CourseCategory.objects.filter(course_category = True).order_by('name')
+ paginator = Paginator(list_cat, self.paginate_by)
+ page = self.request.GET.get('page')
+
+ try:
+ list_cat = paginator.page(page)
+ except PageNotAnInteger:
+ list_cat = paginator.page(1)
+ except EmptyPage:
+ list_cat = paginator.page(paginator.num_pages)
+
+ context['list_cat'] = list_cat
+
+ return context
class CreateCatView(LoginRequiredMixin, HasRoleMixin, generic.edit.CreateView):
--
libgit2 0.21.2