From the course: Building Angular and Django Apps
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Pagination with Django
From the course: Building Angular and Django Apps
Pagination with Django
- [Instructor] On the front end we have the full list of tour packages showing up. However, with Django rest_framework, we can add some pagination to reduce load on the server and the database and to show a smaller amount of packages at a time. So we import PageNumberPagination and then we create a sub class PackagePagination, which is a subclass of PageNumberPagination, and then all we have to do is set the size which will be 10. So 10 packages will be returned from the API, and we just have to update the view set in order to make that happen. So we set the class to PackagePagination class and that's it.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Checking permissions with Django3m 20s
-
(Locked)
Deleting an item using Angular and Django2m 14s
-
(Locked)
Partially updating an item using Angular4m 9s
-
(Locked)
Pagination with Django52s
-
(Locked)
Pagination with Angular3m 29s
-
(Locked)
Filtering with Django2m 38s
-
(Locked)
Filtering with Angular1m 36s
-
(Locked)
Animations in Angular7m 23s
-
(Locked)
-
-
-