Pagination For Django - Django Wednesdays #18

  Рет қаралды 43,780

Codemy.com

Codemy.com

Күн бұрын

Пікірлер: 91
@Codemycom
@Codemycom 3 жыл бұрын
▶️ Watch Entire Django Wednesdays Playlist ✅ Subscribe To My KZbin Channel: bit.ly/35Xo9jD bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN ▶️ Get The Code bit.ly/3sJpeV6
@roranautical6064
@roranautical6064 Жыл бұрын
Your channel and all your knowledge is carrying me through my entire Django project, so thankful for all your videos!
@Codemycom
@Codemycom Жыл бұрын
Glad to hear it!
@tamarapetrova8440
@tamarapetrova8440 Жыл бұрын
Very well explained! I loved it. Saved me a whole bunch of time at work today.
@Codemycom
@Codemycom Жыл бұрын
Happy to hear it!
@kartikeysrivastava9657
@kartikeysrivastava9657 Жыл бұрын
watched three video before this but the way you clear the concept of pagination is just cool.
@Codemycom
@Codemycom Жыл бұрын
Thanks! Glad you liked it!
@akifakif6031
@akifakif6031 Жыл бұрын
Thank you for keeping it short and simple.
@Codemycom
@Codemycom Жыл бұрын
yep
@ammonjerro396
@ammonjerro396 3 жыл бұрын
One of the best teacher in web!
@Codemycom
@Codemycom 3 жыл бұрын
Thanks!
@shriyanshpurohit8706
@shriyanshpurohit8706 3 жыл бұрын
Great Sir!! Wanted to learn Pagination in Django. Thanks!
@Codemycom
@Codemycom 3 жыл бұрын
Glad you liked it!
@mr.marvel2787
@mr.marvel2787 2 жыл бұрын
What ever I am searching u pop out and answer my question... Thank u a lot
@Codemycom
@Codemycom 2 жыл бұрын
Awesome!
@angiepaolamorenojaramillo1834
@angiepaolamorenojaramillo1834 Жыл бұрын
Thanks for your video! i was only making a code for the pagination but i didn't use the for to iterate the objects that i've gotten in the views thanks to the Paginator(...objects.all(), 2). But you explained too well everything. Thank you so much
@Codemycom
@Codemycom Жыл бұрын
Very welcome
@_____vieve
@_____vieve 2 ай бұрын
thank u so much mr white! this is really helpful 😸
@Mai_Tai_Meyers
@Mai_Tai_Meyers Жыл бұрын
Very helpful! I'm working on CS50w and this was a great help on our homework assignment. Thank you!
@Codemycom
@Codemycom Жыл бұрын
Happy to hear it!
@sithuhtun3609
@sithuhtun3609 3 жыл бұрын
This channel is the best for python!
@Codemycom
@Codemycom 3 жыл бұрын
Thanks!
@sthefanocarvalho2823
@sthefanocarvalho2823 Жыл бұрын
Exactly what I needed. Thank you for the excellent content, as always :)
@Codemycom
@Codemycom Жыл бұрын
Glad you enjoyed it!
@PrateekMehta92
@PrateekMehta92 2 жыл бұрын
+1 on we don't want order of things to change (randomly) as we paginate. The use of ? operator (in order_by) is useful but for pagination we need a sequential order of items, python sorting for e.g. has a key parameter to determine the lambda to be used for making comparison between any two items, so basically, what I mean is for any kind of sorting over a set of items, there needs to be a predefined algorithm that evaluates each item using the given key, in case of say a table of "artist_singing_concerts" this key could be the concert date, and we can sort each item based on the most recent concert date, because that is what a visitor to the website might want to attend.
@em0ji266
@em0ji266 3 жыл бұрын
Thank you very much! With your help, I was able to understand and solve this problem!
@venkateshgrow4463
@venkateshgrow4463 3 жыл бұрын
thanks for the video finally i got the output
@kay8379
@kay8379 Жыл бұрын
awesome video, i really aprecciate it
@Codemycom
@Codemycom Жыл бұрын
Welcome!
@vinaypoul
@vinaypoul Жыл бұрын
Nice explaination. Please make a explain video on class-based views in Django.
@Codemycom
@Codemycom Жыл бұрын
I have a whole playlist on that on the channel
@matheusandrade1059
@matheusandrade1059 2 жыл бұрын
Amazing video
@Codemycom
@Codemycom 2 жыл бұрын
Thanks!
@johngiangrande2996
@johngiangrande2996 3 жыл бұрын
Great job, as usual, John!
@Codemycom
@Codemycom 3 жыл бұрын
thanks!
@kyrollssabry7808
@kyrollssabry7808 2 жыл бұрын
Thanks so much ,this helped me a lot 🤩
@philippemele5334
@philippemele5334 2 жыл бұрын
Hi there, I am getting an errror message saying request is not defined. Looking up on google, this problem seems to be related to Flask, however it does not seem flask is being used. Any pointers?
@Pheasant303
@Pheasant303 3 жыл бұрын
Great video, super helpful
@Codemycom
@Codemycom 3 жыл бұрын
Glad you think so!
@harshdeepsingh9324
@harshdeepsingh9324 3 жыл бұрын
please help i am getting nonetype for the page variable Code: p = Paginator(Post.objects.all(), 4) page = request.GET.get('page') trending_posts = p.get_page(page) nums = "a" * trending_posts.paginator.num_pages
@harshdeepsingh9324
@harshdeepsingh9324 3 жыл бұрын
I had tried to print the page and it is printing None please Help!!!!!
@harshdeepsingh9324
@harshdeepsingh9324 3 жыл бұрын
​ @Codemy.com please help
@harshdeepsingh9324
@harshdeepsingh9324 3 жыл бұрын
I tried to go to ?page=1 then only it is returning page 1 but the same page not different
@harshdeepsingh9324
@harshdeepsingh9324 3 жыл бұрын
Error: [22/Jun/2021 13:05:33] "GET / HTTP/1.1" 500 166112 1 Internal Server Error: / Traceback (most recent call last): File "D:\Website\env\lib\site-packages\django\core\handlers\exception.py", line 47, in inner response = get_response(request) File "D:\Website\env\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "D:\Website oblogs\blog\views.py", line 24, in home return render(request, 'blog/home.html', context) File "D:\Website\env\lib\site-packages\django\shortcuts.py", line 19, in render content = loader.render_to_string(template_name, context, request, using=using) File "D:\Website\env\lib\site-packages\django\template\loader.py", line 62, in render_to_string return template.render(context, request) File "D:\Website\env\lib\site-packages\django\template\backends\django.py", line 61, in render return self.template.render(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 170, in render return self._render(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 162, in _render return self.nodelist.render(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 938, in render bit = node.render_annotated(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 905, in render_annotated return self.render(context) File "D:\Website\env\lib\site-packages\django\template\loader_tags.py", line 150, in render return compiled_parent._render(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 162, in _render return self.nodelist.render(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 938, in render bit = node.render_annotated(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 905, in render_annotated return self.render(context) File "D:\Website\env\lib\site-packages\django\template\loader_tags.py", line 62, in render result = block.nodelist.render(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 938, in render bit = node.render_annotated(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 905, in render_annotated return self.render(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 988, in render output = self.filter_expression.resolve(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 671, in resolve obj = self.var.resolve(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 796, in resolve value = self._resolve_lookup(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 858, in _resolve_lookup current = current() File "D:\Website\env\lib\site-packages\django\core\paginator.py", line 204, in previous_page_number return self.paginator.validate_number(self.number - 1) File "D:\Website\env\lib\site-packages\django\core\paginator.py", line 53, in validate_number raise EmptyPage(_('That page number is less than 1')) django.core.paginator.EmptyPage: That page number is less than 1 [22/Jun/2021 13:06:11] "GET /?page=1 HTTP/1.1" 500 166460 2 Internal Server Error: / Traceback (most recent call last): File "D:\Website\env\lib\site-packages\django\core\handlers\exception.py", line 47, in inner response = get_response(request) File "D:\Website\env\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "D:\Website oblogs\blog\views.py", line 24, in home return render(request, 'blog/home.html', context) File "D:\Website\env\lib\site-packages\django\shortcuts.py", line 19, in render content = loader.render_to_string(template_name, context, request, using=using) File "D:\Website\env\lib\site-packages\django\template\loader.py", line 62, in render_to_string return template.render(context, request) File "D:\Website\env\lib\site-packages\django\template\backends\django.py", line 61, in render return self.template.render(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 170, in render return self._render(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 162, in _render return self.nodelist.render(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 938, in render bit = node.render_annotated(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 905, in render_annotated return self.render(context) File "D:\Website\env\lib\site-packages\django\template\loader_tags.py", line 150, in render return compiled_parent._render(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 162, in _render return self.nodelist.render(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 938, in render bit = node.render_annotated(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 905, in render_annotated return self.render(context) File "D:\Website\env\lib\site-packages\django\template\loader_tags.py", line 62, in render result = block.nodelist.render(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 938, in render bit = node.render_annotated(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 905, in render_annotated return self.render(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 988, in render output = self.filter_expression.resolve(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 671, in resolve obj = self.var.resolve(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 796, in resolve value = self._resolve_lookup(context) File "D:\Website\env\lib\site-packages\django\template\base.py", line 858, in _resolve_lookup current = current() File "D:\Website\env\lib\site-packages\django\core\paginator.py", line 204, in previous_page_number return self.paginator.validate_number(self.number - 1) File "D:\Website\env\lib\site-packages\django\core\paginator.py", line 53, in validate_number raise EmptyPage(_('That page number is less than 1')) django.core.paginator.EmptyPage: That page number is less than 1 [22/Jun/2021 13:06:23] "GET /?page=2 HTTP/1.1" 500 166460
@hendmohamed3919
@hendmohamed3919 2 жыл бұрын
@@harshdeepsingh9324 I also have the same problem,What is the solution please??
@moowmotors
@moowmotors 2 жыл бұрын
Thanks for lesson
@Codemycom
@Codemycom 2 жыл бұрын
welcome
@artaken7449
@artaken7449 6 ай бұрын
Great tutorial thank you very much, But you gotta do something about the intro sound, It is really annoying specially when using headphones 0:05
@NULL-xq2qz
@NULL-xq2qz 2 жыл бұрын
this was helpful, thanks!
@Codemycom
@Codemycom 2 жыл бұрын
welcome!
@hoxas
@hoxas 2 жыл бұрын
Nice 🤩 thank you
@Codemycom
@Codemycom 2 жыл бұрын
welcome!
@abdelrhmanmohey535
@abdelrhmanmohey535 2 жыл бұрын
if i created any post or get request to filter my data is disappear as soon as i go to any other page
@dragonfire2926
@dragonfire2926 2 жыл бұрын
I tried this using POST method in a search form but it shows a value error ?
@Codemycom
@Codemycom 2 жыл бұрын
What did you do differently from the video?
@farhadtabrizi4878
@farhadtabrizi4878 3 жыл бұрын
Hi I have tried pagination on the blog page view you taught in django which is a class based view (the homepage of blog), while implementing pagination the first page is ok but on next pages it losses template formatting, for instance the contents get out of "container-fluid" div. Would you please help me on this? Thanks
@SCBealer
@SCBealer 2 жыл бұрын
Legend, thank you!
@sumanchakravarty7712
@sumanchakravarty7712 3 жыл бұрын
can you suggest a way to monitor daily traffic?
@Codemycom
@Codemycom 3 жыл бұрын
google analytics
@adhy612000151
@adhy612000151 2 жыл бұрын
Thanks Sir!
@Codemycom
@Codemycom 2 жыл бұрын
Welcome!
@someshh7263
@someshh7263 3 жыл бұрын
Sir.. Waiting for django e-commerce website with class base views and adding items in cart using session..
@Codemycom
@Codemycom 3 жыл бұрын
built one in visual studio 25 years ago lol
@yunasan8755
@yunasan8755 3 жыл бұрын
Help a lot! thank you!
@Codemycom
@Codemycom 3 жыл бұрын
Welcome!
@canislatrans6606
@canislatrans6606 2 жыл бұрын
Congratulations John! great video, very clear and you have fresh happy style, cool bro. do we need to bring always all the objects to use the paginator? does it has sense to use the paginator if I have only the objects that belong to a specific page? thanks in advance :)
@prasadmande8489
@prasadmande8489 3 жыл бұрын
Sir please make video on how to do periodic task in django for sending E-mail
@Codemycom
@Codemycom 3 жыл бұрын
There's not a good way to natively send email in Django, you need to use a third party service.
@prasadmande8489
@prasadmande8489 3 жыл бұрын
@@Codemycom i found celery for periodic task in django but unable to understand sir . Will you please teach me
@Codemycom
@Codemycom 3 жыл бұрын
@@prasadmande8489 No, sorry
@aryariski00
@aryariski00 2 жыл бұрын
sir how the urls code for pagination?
@Codemycom
@Codemycom 2 жыл бұрын
Everything you need is in the video
@vigneshwarselva9276
@vigneshwarselva9276 2 жыл бұрын
hello sir, it was great .. can u pls make a video on relational models and querying objects in models
@Codemycom
@Codemycom 2 жыл бұрын
The videos in this playlist are all using relational models and querying objects...keep watching the playlist.
@ahmedghallab5342
@ahmedghallab5342 Жыл бұрын
شكرا Thanks
@Codemycom
@Codemycom Жыл бұрын
Welcome
@odiljondjamalov8965
@odiljondjamalov8965 Жыл бұрын
thank you
@Codemycom
@Codemycom Жыл бұрын
Welcome
@ameyamahadevgonal8130
@ameyamahadevgonal8130 2 жыл бұрын
That's perfect
@Codemycom
@Codemycom 2 жыл бұрын
glad you liked it!
@mohammadaliakbari269
@mohammadaliakbari269 3 жыл бұрын
great!!!thanks
@Codemycom
@Codemycom 3 жыл бұрын
Sure thing!
@parhamilaghi1789
@parhamilaghi1789 Ай бұрын
@Mirgani7
@Mirgani7 3 жыл бұрын
Thanks
@Codemycom
@Codemycom 3 жыл бұрын
Welcome
@Boilnardo
@Boilnardo 6 ай бұрын
perfect
@Codemycom
@Codemycom 6 ай бұрын
thanks
@krebill
@krebill 3 жыл бұрын
love you
@Codemycom
@Codemycom 3 жыл бұрын
thanks!
@joaonogaroli2165
@joaonogaroli2165 2 жыл бұрын
Hi, this is work with flask? ex: have a flask.core.paginator ? i'm searching but nothing...
@Codemycom
@Codemycom 2 жыл бұрын
No, flask is different.
Login With User Authentication - Django Wednesdays #21
21:25
Codemy.com
Рет қаралды 185 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
Django Pagination
28:20
KenBroTech
Рет қаралды 9 М.
Search Products - Django Wednesdays ECommerce 26
21:05
Codemy.com
Рет қаралды 6 М.
Django Rest Framework API #31 / Improve API Response Using Pagination
7:04
Python Django Tutorial: Full-Featured Web App Part 11 - Pagination
37:01
Django-Taggit - Adding Tags to Django Models
19:24
BugBytes
Рет қаралды 8 М.
Learn Django Class Based Views - ListView - Theory and Examples
21:59
Django live search | live search using django and javascript
20:07
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН