Python Django Tutorial: Full-Featured Web App Part 11 - Pagination

  Рет қаралды 227,220

Corey Schafer

Corey Schafer

Күн бұрын

Пікірлер: 539
@riturajjain5301
@riturajjain5301 5 жыл бұрын
Corey: "And Django makes this easy for us." Me: "No, you make this easy for us :)"
@victoralarcontorres8629
@victoralarcontorres8629 5 жыл бұрын
nice
@humayunkabir7925
@humayunkabir7925 4 жыл бұрын
EXACTLY
@bharatjha
@bharatjha 4 жыл бұрын
exactly ... This is second time I going through corey sir videos and cant tell how easy django looks to me ... Thanks millions and zillions to corey sir ....
@markothedev5773
@markothedev5773 4 жыл бұрын
sooo true
@idugi
@idugi 5 жыл бұрын
Corey, there is a serious lack of quality Django tutorials out there. You are the only one pumping them out. Your series is incredible. I know you must be busy with so many project ideas already, but could you try extending this series into an advanced series next? I feel like I've learned a lot, but I would like to see you tinker around with the styling, or integrating new apps from Django Packages. I still don't feel fully confident in straying off the path you've laid out for us. I'm sure there are many others like me who would love to see more examples of customization now. I also looked into Mezzanine and Wagtail as CMS options, but again, there are very few tutorials on either of those platforms either. If you're ever looking for other ideas for further series, maybe one on using a CMS would be cool too :). You're the best man, and I'm going to forever point people looking to learn python, to your KZbin.
@AnthonySherrill
@AnthonySherrill 5 жыл бұрын
I appreciate that you don't cut out when you do mistakes. I think it's important for beginners like me to see how you debug them and that even a professional like you can have a typo. Great videos. Thanks a lot!
@SliderHavoc
@SliderHavoc 5 жыл бұрын
I really enjoy how you not only show how to do things, but explain some of the processes behind the operations. If gives inspiration for other creative ideas and uses.
@AymenLagha
@AymenLagha 5 жыл бұрын
I really like it when Corey fids a mistake and fix it in seconds I spend hours debugging an indentation
@coreyms
@coreyms 5 жыл бұрын
Oh I get stuck for hours on mistakes all the time. It just doesn’t seem that way in the videos because I’ll edit them out to save viewers time. But it definitely happens
@ankitpandey4602
@ankitpandey4602 5 жыл бұрын
Probably the best tutorials on Django. Thanks-a-lot Corey, your content is not less than magic simple, detailed and obviously well explained. Thanks a-lot.
@bentwite3093
@bentwite3093 5 жыл бұрын
I would love to see a part 2 of this series
@sarthakbhutani7413
@sarthakbhutani7413 4 жыл бұрын
there is a Part 2 of this series. You are currently on Part 11
@bentwite3093
@bentwite3093 4 жыл бұрын
@@sarthakbhutani7413 Where can i find it? please help
@pavankabadi9359
@pavankabadi9359 4 жыл бұрын
@@bentwite3093 hes joking
@rubel1477
@rubel1477 3 жыл бұрын
He means Season 2, lol
@mrchi6611
@mrchi6611 4 жыл бұрын
Corey. Your tutorials are premium quality. Anyone who says otherwise is just insane. I would love it if you can make a tutorial on how you learn(Especially going through documentation) because I don't know how you dig out some deep concepts but I would love to learn.
@michaelng1049
@michaelng1049 6 жыл бұрын
For those that are having trouble with adding the extra posts from the posts.json, make sure you have the user id exists for id 1 and id 2 and you did not delete that user. You can check with this command in the shell: from django.contrib.auth.models import User User.objects.get(id=1) # make sure this returns a user User.objects.get(id=2) # make sure this returns a user If no user is returned, make a new user with the : User.objects.create_user(username='missing', email='missing@email.com', password='testing321', id=) Hope this helps. Corey is the bomb.
@jhodalouiseembodo4586
@jhodalouiseembodo4586 5 жыл бұрын
TY!!!!!!!
@tanjaa9092
@tanjaa9092 11 ай бұрын
it gives an error of TypeError: Profile.save() got an unexpected keyword argument 'force_insert' I just edited the json file to go around that. For now
@robmenon1922
@robmenon1922 4 жыл бұрын
I may have downloaded your c. 80 videos using youtube-dl but I'm still coming back to hit that like button, you're a saint to aspiring devs everywhere, keep it up!
@paramveermarwah862
@paramveermarwah862 2 жыл бұрын
You making videos with an actual sense of spreading knowledge instead of buying likes and shares. One of the best Django tutorials available on internet. Thankyou from Germany.
@berkayyalcn5149
@berkayyalcn5149 5 жыл бұрын
Many times I refused to watch youtube tutorials because I think that they are useless.Today I watched your 11 videos continuously thank you I wish you will get a fair shot :)
@coreyms
@coreyms 5 жыл бұрын
Thanks!
@ritvikdayal3735
@ritvikdayal3735 4 жыл бұрын
You are the only person who can teach complicated stuff in most simplest way.
@nicolasroosz
@nicolasroosz 4 жыл бұрын
Big thumb up for all this tutorial ! It's really simple and clear to understand ! For those like me who are using django in version > 3, for the order_by in the get_queryset method, we need to do it before the filter call like : >
@eamonburns9597
@eamonburns9597 Жыл бұрын
Doing it the way he did in the tutorial worked fine for me. Django 4.2.3 🤷‍♂
@carekaro007
@carekaro007 4 жыл бұрын
Honestly Bro! I was doing your django series after that I took udemy course and realised that first two projects were real shit. Got only 2 to 3 different pieces of information from those udemy videos. Did your series again and understood the concepts in more clearity. You are the only one out there carrying this quality stuff out there. There is serious lack of quality stuff out there. It would be very helpful if you could make a course on DJANGO REST FRAMEWORK. Need guidance in that part. Thank you for everything you are doing for us and we also make sure that we will watch all the ads and visit the pages as a support to this channel. Love for your dog from India.
@Ayasir-lo3ir
@Ayasir-lo3ir 4 жыл бұрын
I'm 13 years old this is a best courses out there
@2024comingforyou
@2024comingforyou 3 жыл бұрын
@@Ayasir-lo3ir I am 5 years old and i think you are right
@angelicking2890
@angelicking2890 2 жыл бұрын
@@2024comingforyou I came straight off my dad's telescope and I'm already being genetically coded to learn from Corey Django's series.
@parthmadan671
@parthmadan671 2 жыл бұрын
I'm still in the womb and this is the best course I have ever watched on django
@FernandoFerrariFernandes
@FernandoFerrariFernandes 4 күн бұрын
With 10 videos you taught me the basics of Django. You are awesome. Thank you very much!
@ivancarcallas5510
@ivancarcallas5510 4 жыл бұрын
Thanks for this Corey :) I tried to add a functionality to display all my post by visiting my profile page and clicking the profile picture. :) And successfully done it. Hehe So proud of myself. Thanks Corey sir. :) Just sharing. Hehe
@michaelcortes39
@michaelcortes39 5 жыл бұрын
This whole tutorial series is beast mode. It would be amazing if you could make a tutorial series on building a simple ML app. Something like the user gives some text input and the output is some sentiment score or something using scikit-learn, tensor flow, or pytorch. I would love to see how you would design the layout of that kind of website/web-app using Django.
@oyediranthanniquowiyyu5827
@oyediranthanniquowiyyu5827 3 жыл бұрын
Simply the best Django tutorial you'll ever see on the internet
@pavankabadi9359
@pavankabadi9359 4 жыл бұрын
YOOOOO!! My dream just came true. I like the video at 2.9k likes and made it 3k. Lets GO! I am just 14, but Corey Schafer you are amazing. Thank you so much for these videos and I am truly thankful that you are helping me further my programming journey. Thank you so much!
@coreyms
@coreyms 4 жыл бұрын
Nice! Thanks!
@shashikalaraju5769
@shashikalaraju5769 3 жыл бұрын
I spent 2 hours figuring out it was supposed to be get_queryset() not get_query_set() and just when I planned on sharing this valuable info in comments, as I moved ahead of video to get the screen he explained this. Oh god.. don,t know if jumping ahead is good or bad anymore.:( But greatful for the content Corey. Almost everything I know in Django is because of you. Thank you.
@aliozreil23
@aliozreil23 4 жыл бұрын
one of the best teachers on youtube
@davidblair1671
@davidblair1671 4 жыл бұрын
No words to say beyond other viewer comments! Creating personal Operations Manual step by step for a foundation of future projects thanks to you! Ready to complete this and dive into other topics by you...!
@YasBars
@YasBars 4 жыл бұрын
Thanks for always showing the errors and how we can fix them. This is the best Django tutorial I have watched so far. :)
@erwinnovo3014
@erwinnovo3014 3 күн бұрын
Great tutorial, Corey! Amazing! Kudos!
@thomasworkersen2972
@thomasworkersen2972 3 жыл бұрын
For anyone stuck with pagination, yeah, this changed in newer versions of django. with Django 3.0 i get pagination on the users-post page, but the not post page itself. As corey said, this part of the code is not DRY(repeated code in both html files regarding actual pagination) but still they behave differently.
@parvejshahlabib9167
@parvejshahlabib9167 2 жыл бұрын
I did the same and it worked. But I always follow documentation before writing code.
@jonasc8569
@jonasc8569 3 жыл бұрын
This is the best Heroku deployment tutorial ever!
@lc5242
@lc5242 4 жыл бұрын
Thank you so much for being patient with us, even without seeing us.
@moebazzi8412
@moebazzi8412 6 жыл бұрын
AMAZING AND CLEAR TUTORIALS WELL DONE COREY!!!
@paridhigupta2747
@paridhigupta2747 2 жыл бұрын
Loving the series. Thanks Corey!
@judithtorres1767
@judithtorres1767 2 жыл бұрын
Thank you for this tutorial, Corey. You're an angel. Hope you're doing fine wherever you are right now.
@drhastings
@drhastings 4 жыл бұрын
Mr Corey Schafer Thank You for these awesome , informative tutorials
@k.m.emonahmed4938
@k.m.emonahmed4938 4 жыл бұрын
You are love, Thank's for making Django easy for us, I will never able to complete my final year project(B.Sc) without your loving playlist of Django, it helped me a lot
@srinadhk8071
@srinadhk8071 5 жыл бұрын
I generally use Adblock but just for your videos I specifically disable Adblock.. really thank you very much. !!..
@coreyms
@coreyms 5 жыл бұрын
Thanks!
@haerrymarcel
@haerrymarcel Жыл бұрын
Awesome job sir! usually i'm on c# but this really makes appetite
@thesciencethatilove8959
@thesciencethatilove8959 4 жыл бұрын
i really felt bad when you are saying sorry, we are all learning because of you, so you can make as many as u want
@sarveshgandhi4588
@sarveshgandhi4588 4 жыл бұрын
Me: Watching corey's video Corey: I know that this is confusing especially when you're not actually doing it
@1000marcelo1000
@1000marcelo1000 3 жыл бұрын
At 22:00 in the end of paginations. I did some changes on the pagination buttons I hope you like it: {% if is_paginated %} {% if page_obj.has_previous %} First Previous {% else %} First Previous {% endif %} {% for num in page_obj.paginator.page_range %} {% if page_obj.number == num %} {{ num }} {% elif not page_obj.has_previous %} {% if num = page_obj.number|add:'-2' %} {{ num }} {% endif %} {% elif num >= page_obj.number|add:'-1' and num
@shemmuthanga6352
@shemmuthanga6352 3 жыл бұрын
Hi Marcelo, this part is not right I'm afraid {% else %} First Previous {% endif %} because it will be visible even if there isn't a previous page, which should not be the case. same with this: {% else %} Next Last {% endif %} it will appear even when there isn't a next page. Also, their href attributes are '#', meaning they will not change to a particular page
@1000marcelo1000
@1000marcelo1000 3 жыл бұрын
​@@shemmuthanga6352 To be honest I don't know exactly what's going on in that piece of code, but anyway, here's what i meant with this code: I wanted the buttons to appear even if there is no previous page before the first one and even if there is no later page after the last one.
@1000marcelo1000
@1000marcelo1000 3 жыл бұрын
And to avoid confusion I changed the colors by changing the class from "btn btn-outline-info mb-4" to "btn btn-outline-secondary mb-4". Try it in your django code see what you think :P
@junecnol79
@junecnol79 4 жыл бұрын
1:40 getting data from json in shell 4:45 Paginator 8:45 using Paginator with class based view (CBV) 11:30 adding pagination UI in templates 23:00 filtered data Paginator with class based view (CBV) get_queryset 25:05 get_object_or_404
@waiitwhaat
@waiitwhaat Жыл бұрын
To anyone getting an error when creating posts: I have noticed there is a small error maybe due to changing of Django versions When creating posts, providing author_id = post['user_id'] gives an error. Just do a user = User.objects.get(id=post['user_id']) before making the post and instead of author_id, do author = user. Of course you will need to import User model as explained in previous videos.
@alexkoshy1999
@alexkoshy1999 Жыл бұрын
importing User model... from django.contrib.auth.models import User right?
@alexkoshy1999
@alexkoshy1999 Жыл бұрын
but still shown error : User matching query does not exist.
@dihajnasah8077
@dihajnasah8077 Жыл бұрын
@@alexkoshy1999 did u solve bro..i am still stuck in this problem
@alexkoshy1999
@alexkoshy1999 Жыл бұрын
@@dihajnasah8077 no bro...i leaved it..and manually posted some gibberish post
@mightyprogrammer2899
@mightyprogrammer2899 Жыл бұрын
@@alexkoshy1999 No bro no need to add gibberish post its not good practice this is how i identify my users id from shell , because at the first i have created some users and deleted for some resons thats why i has been facing this issue here is the shell code which i have used >>> user = User.objects.all() >>> user >>> user = user.first() >>> user >>> user.id 9 >>> user = User.objects.all() >>> user >>> user = User.objects.get(username='NewUser') >>> user >>> user.id 10 >>> i hope this would help
@LegendHxz
@LegendHxz 5 жыл бұрын
After overriding the save function in users/models.py I was unable to create new users. a fix to this was changing: def save(self): super().save() to: def save(self, *args, **kwargs): super().save(*args, **kwargs) Hope it helps somebody! Thank you for everything that you do Corey. Keep it up. Your tutorial has restored my motivation!
@abdishakuraliisse3214
@abdishakuraliisse3214 5 жыл бұрын
thanks alot
@shreshtharora
@shreshtharora 5 жыл бұрын
Thanks A lot Found a solution
@shreshtharora
@shreshtharora 5 жыл бұрын
The save method update solved creation of Profile Problem but new error generates saying default.jpg doesn't exists in media folder even though it exists. Tried even restating the development server . problem still persists
@DannyhEvolution
@DannyhEvolution 5 жыл бұрын
i had the same issue
@glambyha2263
@glambyha2263 4 жыл бұрын
Thankyou so much ,i realized i wasn't able to create user after reading your comment :D
@paulohsgoes1959
@paulohsgoes1959 4 жыл бұрын
Once again, a great video of yours. Congrats!
@MagnusAnand
@MagnusAnand 5 жыл бұрын
great video! And as others have mentioned, it's nice to see how you solve errors as well.
@abhishekk1231
@abhishekk1231 4 жыл бұрын
Thank you so much for this video!!! I was stuck on this problem from a long time and was thinking to apply concept of Lazy Loading, but this solves my problem. Thankyou!
@shazkingdom1702
@shazkingdom1702 5 жыл бұрын
Thank you 🙏 -this JSON thing is extremely helpful
@randomuser5780
@randomuser5780 3 жыл бұрын
man you're just Amazing! Really your courses are better than those Udemy paid ones
@yehonatan3000
@yehonatan3000 Жыл бұрын
To any of you who get an error of django.db.utils.IntegrityError: FOREIGN KEY constraint failed. That can be happening for some reasons (most of them are detailed in the comments), but I didn't see any comment addressing the problem I had. Because I played with the creation of the user a little bit, my user_ids weren't 1, 2, and 3. However, the JSON file contains user_id of 1, 2, and 3, so I basically tried to upload a post to an unexisting user. To check the user_id of each user you can do the following: from django.contrib.auth.models import User users = User.objects.all() for user in users: print(user.id) After that, you need to update the user_id in the JSON file to one of the numbers you have. Hope it helps!
@GenadiGenchev900
@GenadiGenchev900 Жыл бұрын
THANK you!
@danieloluwakemi9088
@danieloluwakemi9088 7 ай бұрын
thanks
@giv123
@giv123 4 жыл бұрын
2 and a half hours later to finally get it working and my head is about to burst! haha
@guitardave77
@guitardave77 3 жыл бұрын
Love these tutorials man
@abishvijayan76
@abishvijayan76 5 жыл бұрын
32:55; No need to replace post with object, Doing this can induce an error. btw Great Series, Great Work, Thanks a lot.
@oli2034
@oli2034 5 жыл бұрын
You don't know how many people appreciate your services
@FreedomOverSafety
@FreedomOverSafety 4 жыл бұрын
Thank you for these wonderful videos!
@JasonPavlas
@JasonPavlas 2 жыл бұрын
Mr. Schafer! You are a boss!!!! That is all :)
@dpapa2175
@dpapa2175 4 жыл бұрын
The way this begins with importing JSON, is a neat touch. Django is amazing. Btw- Which beers improve your programming?
@jaysonmartinez7026
@jaysonmartinez7026 4 жыл бұрын
Hi Corey, Thank you for this great tutorial. I have learned a lot.
@adamploof3528
@adamploof3528 4 жыл бұрын
35:35 "You won't believe these clickbait titles!" -- thought that was pretty funny.
@miraihibino2213
@miraihibino2213 4 жыл бұрын
Hi corey, this entier tutorial is incridible and understandable , but can you extend this series a bit and let us know how to implement chat feature so that users can chat as well after logging in
@2hourgameplay2minutereview52
@2hourgameplay2minutereview52 2 жыл бұрын
I found this tutorial to be pretty helpful, thank you. I was wondering if you will do another part on many-to-many relationships for models particularly in relation to CRUD. Maybe for example for your blogs, you can have tags.
@investradelearn
@investradelearn 4 жыл бұрын
smashed the liked like hulk and subscribed, excellent tutorial my friend many thanks! regards from Peru!
@zommanderz3605
@zommanderz3605 4 жыл бұрын
Thank you Corey!
@ai.201
@ai.201 4 жыл бұрын
Corey, you are good.
@gregtuve1109
@gregtuve1109 5 жыл бұрын
Corey, if you could bottle this and sell it... but then, you're probably already rich from working as a programmer. It would be pretty cool if you could find someone who knows as much as you do--but about other computer topics, then teach them how to plan a recording session. You could sell it as a documentation service to companies with products like Django and Git. Anthony Sherrill says you don't edit your mistakes out, but the vast majority of them appear to be planned mistakes--not mistakes at all. I was using another set of tutorials, but that guy wasted oodles of time just chit chatting. I love the way you plan, follow your plan, and get to the next point.
@coreyms
@coreyms 5 жыл бұрын
I perform a lot of edits on my videos. I'll leave mistakes in if I feel like they have some value to the viewer, but if they are mistakes that won't give any value then I try to edit them out.
@daon23
@daon23 Жыл бұрын
if anyone is following this tutorial at the date of this comment and having trouble with the json file, you can: from django.contrib.auth.models import User and then modify the query a bit i did for p in posts_json: post = Post(title=p['title'], content=p['content'], author=User.objects.get(pk=p['user_id'])) post.save() django expects a user object instead of just the primary key, at least in django 4.2.1 which is what I'm using.
@verilogmusic
@verilogmusic Жыл бұрын
Thank you, sir 🎩
@paulnelson8009
@paulnelson8009 8 ай бұрын
Thank you!! this fixed my issue
@MaximRyzhenkov
@MaximRyzhenkov 4 жыл бұрын
Thanks a lot for your lessons!
@codenaman
@codenaman 4 жыл бұрын
thanks corey.. you are the pure sole.. Someday I am really going to meet you.
@LizzyHanamiya
@LizzyHanamiya 4 жыл бұрын
*Corey:* Apologizes for making two small mistakes. *Me who makes 10000+ typos even after watching his videos:* um....i-it's totally okay mate...
@maninandadeepmedicharla6213
@maninandadeepmedicharla6213 5 жыл бұрын
after loading the JSON file and saving every post in it I am getting a django.db.utils.IntegrityError: FOREIGN KEY constraint failed Error please help me with this issue
@afonsosalbrecht
@afonsosalbrecht 4 жыл бұрын
same error
@shivak6696
@shivak6696 4 жыл бұрын
+1
@Reddithours1126
@Reddithours1126 4 жыл бұрын
having error because of user_id value.. in database user_id for each user doesn't restore if you delete a user from database. I mean if you delete a user whose user_id was 2, if you create new user, then index 2 will not be assigned to any user, it will remain null and new_user id will be 3.
@mahaheruka4966
@mahaheruka4966 4 жыл бұрын
As pointed out: Whenever you delete and create a new user, primary key (pk) and user id (id) will continue and not be reset. Therefore, if you followed the tutorial, chances are high you don't have users with id 2 anymore. Hence, in posts.json you need to replace id 2 with a corresponding value. To find good id values you need to query the db. First, open a shell: python manage.py shell Second, in the Python shell run these commands to find all ids of all users: from django.contrib.auth.models import User users = User.objects.all() for user in users: print(user.id) Third, in posts.json replace the ids with valid ids from your db.
@Whack777
@Whack777 4 жыл бұрын
@@mahaheruka4966 Thank you for this .... you provided the solution for me...
@boryskuczkowski
@boryskuczkowski 6 жыл бұрын
@4:08 well, could you please please show how to add images to posts, I was thinking about django-ckeditor, or maybe just a simple form one image per post plus thumbnail in the listview on home.html along with search section would spice up the blog even further. Thank you for this tutorial, it's great!
@davidger6557
@davidger6557 5 жыл бұрын
I need this as well
@jorgegonzaloalfaro5378
@jorgegonzaloalfaro5378 3 жыл бұрын
I would pay around 20$ for an advanced django tutorial from Corey Schafer and I NEVER PAY for coding material.
@mohammadmasbahuddin2812
@mohammadmasbahuddin2812 5 жыл бұрын
We want E-Commerce Tutorial :)
@eugenetuhaisr6829
@eugenetuhaisr6829 10 ай бұрын
Hey, am getting anl template syntax error at line 24, time: 20:02. Could not parse remainder '|' from 'page_obj.number|'. Please help 🙏 🙏🙏🙏🙏🙏🙏🙏🙏
@TopPlayer17535
@TopPlayer17535 7 ай бұрын
in the elif line make sure that the 'add' comes directly after | so it looks something like this '|add' this helped me
@miguelmyers9546
@miguelmyers9546 6 жыл бұрын
I would love to see you do a flask api tutorial
@mahathirmohammad8635
@mahathirmohammad8635 3 жыл бұрын
Corey Schafer made 2 mistakes in one video. It is 8th wonder to me. really, It is more rare than human goes to the moon. I'm really impressed.
@Yowmshot
@Yowmshot 5 жыл бұрын
I would like to inform you guys, instead of using get_query_set function, it should be get_queryset function (only one underscore '_') to successfully filter out the username in counting the number of post and display its posts. I don't know if it has something to do with the django versioning but, if you were using get_query_set function, it will not work. Sir Corey, please double check this. Thankss! Anyone correct if i'm wrong - 24:39
@coreyms
@coreyms 5 жыл бұрын
You’re right. I fixed it at the 34:00 minute mark
@javaguitarist
@javaguitarist 4 жыл бұрын
Thanks for that because without the fix it was returning all posts.
@ahmad-ali14
@ahmad-ali14 5 жыл бұрын
this is the best toturial
@nmddiez6374
@nmddiez6374 5 жыл бұрын
Hey Corey, maybe in the next tutorial you can show us how to use django-cities feature for the registration form?
@alexanderten5497
@alexanderten5497 6 жыл бұрын
you are the BEST of the BEST. thank youuuuuu:))
@cudanakiju0
@cudanakiju0 4 жыл бұрын
I love that series, actually I've learned most of my Django skills here;) Is there a chance that you'll make one on cookies handling/ session storing?
@r31n0ut
@r31n0ut 11 ай бұрын
That small heart attack you get when you test something and it doesn't work because you swear you followed the instructions but then it turns out Corey made the same mistake and it's fixed 2 minutes later.
@mehmetyuksel3217
@mehmetyuksel3217 3 жыл бұрын
awesome tutorial!
@lingxu3570
@lingxu3570 4 жыл бұрын
Great lecture!! I experienced some error following along of the video, please refer to the code above if you experience error as well
@vatsa1732
@vatsa1732 5 жыл бұрын
Thanks a lot for these video.
@shashanksharmadon4295
@shashanksharmadon4295 4 жыл бұрын
Awesome bro thanks best video ever.....
@shreyadeo315
@shreyadeo315 3 жыл бұрын
I have question if anyone can answer, how to get familiar with all these methods. We can't remember all these methods right? Where to check for them if we forgot ? Great Series Corey. I am learning more from you than my university lecturers. And thank you!! AS Soon AS I will get my first job, I am gonna contribute to your channel through patreon.
@user-tx1ip
@user-tx1ip 6 жыл бұрын
You are awesome!!
@hasan8267
@hasan8267 5 жыл бұрын
Great tutorials! Thanks
@lukengirubiu6492
@lukengirubiu6492 3 жыл бұрын
Hello? How would i go about inserting new posts using the shell in windows? Mine is showing that it's running perfectly but no post is added
@robertschmidt8624
@robertschmidt8624 Жыл бұрын
I was unable to to add he posts.json using the import json... I have a Mid 2010 macbook pro laptop for what it's worth. I'd like to add those addiional profiles if possible.
@Schmidt3k
@Schmidt3k 4 жыл бұрын
At 28:40, remember to add the forward slash in the end of the string. I did not and ran in to some 404-issues for certain users (not all).
@Lluviso
@Lluviso 5 жыл бұрын
when i run post.save(), it raises an error: "sqlite3.IntegrityError: FOREIGN KEY constraint failed", why?
@isaiaskaung8856
@isaiaskaung8856 5 жыл бұрын
I have the same error
@VictorOlet
@VictorOlet 5 жыл бұрын
@@isaiaskaung8856 I have the same error too.
@rafaelperezmederos6958
@rafaelperezmederos6958 3 жыл бұрын
I have the same error as well has anyone found the solution?
@tsquare6047
@tsquare6047 3 жыл бұрын
@@rafaelperezmederos6958 Heya I just managed to solve this problem. You essentially just have to ensure that you have users with the user_id of 1 and 2. I somehow didnt have a user with user_id of 2 so i just wrote this instead: post = Article(title=post['title'], content=post['content'], author_id=1) and it worked
@manikndn8
@manikndn8 6 жыл бұрын
Wonderful
@glaceondev4149
@glaceondev4149 4 жыл бұрын
lmaooo F for those who bought couses from udemy...love ya corey youre so great! :D
@inodecode7600
@inodecode7600 4 жыл бұрын
I noticed, that if you are doing this in command prompt for windows users, @ 2:25 you need to tab twice!
@inodecode7600
@inodecode7600 4 жыл бұрын
Also, I noticed if you make errors as typing this, even fixed it wont work, you have to start over from command prompt and start from import json
@Mia-vz6yt
@Mia-vz6yt 5 жыл бұрын
Hi Corey, thanks for the awesome video. Could you please help to teach how to control the length of post? I mean, just display part of them, and the rest of the post will be hidden since the post is long. Thanks!
@vladusa
@vladusa 4 жыл бұрын
Hi Mia! Since Corey won't respond, I will :) Just search truncatechars:200 on the internet and read the documentation. You can shorten posts by going to post.content, putting a | character, and typing truncatechars: with however many characters to display. You can add a read more below that links to post detail view.
@headlikeahole6548
@headlikeahole6548 6 жыл бұрын
Corey, could you elaborate on the variable {{ views.kwargs.username }} in the user_post.html file? What is 'views.kwargs' part ?
@Canda-fh4xc
@Canda-fh4xc 5 жыл бұрын
views.kwargs means : kwargs stands for keyword arguments. It is a lookups on dictionary in template. Referring to the function get_queryset inside {view.py .... username=self.kwargs.get('username'} file. Basically, it is asking the function get_queryset from view.py file to pass the username as an argument to it. view.kwargs.username Please Corey correct me if i'm wrong?
@fangle0121
@fangle0121 5 жыл бұрын
Shouldn't it be views.py rather than view.py? @@Canda-fh4xc
@fangle0121
@fangle0121 5 жыл бұрын
The answer probably is this: stackoverflow.com/questions/45098826/access-kwargs-from-a-url-in-a-django-template
@ebukagnwa9834
@ebukagnwa9834 3 жыл бұрын
@@fangle0121 This link was helpful
@pavankulkarni2444
@pavankulkarni2444 4 жыл бұрын
for pagination when i created another user, the profile of the new user is not being created instead an error message is thrown which says - save() got an unexpected keyword argument 'force_insert
@coreyms
@coreyms 4 жыл бұрын
There is an issue with the code in this video that I fixed in the later videos. If you're getting an error that says something like "save() got an unexpected keyword argument 'force_insert'" then please update the save method in users/models.py to the following: def save(self, *args, **kwargs): super().save(*args, **kwargs)
@andysondur
@andysondur 3 жыл бұрын
Hi Corey, Great videos. I'm learning a lot here Could you also teach how to show post's excerpts instead of the full post on the home page?
@bennykhatri1156
@bennykhatri1156 4 жыл бұрын
Hi corey, i am getting TypeError: 'dict' object is not callable error while calling the saving function. Can you please help?
@haenleinjane9594
@haenleinjane9594 3 жыл бұрын
Thanks for this tutorial, I really enjoy the way you teach. But I have a problem with the if elif statement in home.html: throws this error :"TemplateSyntaxError at / Invalid block tag on line 32: 'elif', expected 'empty' or 'endfor'. Did you forget to register or load this tag?" I've bee through my code several times, even erased that part and started all over again, checked all my templates, but not working... any idea? thanks
@GDLAPROD
@GDLAPROD 2 жыл бұрын
hey did you find a workaround/solution for this?
@junhuama68
@junhuama68 4 ай бұрын
Did you find the solution? Anyone?
@mozenrathzerksis174
@mozenrathzerksis174 5 жыл бұрын
20:16 TemplateSyntaxError at / add requires 2 arguments, 1 provided. i could not able to resolve issue please help.
@hangroups1170
@hangroups1170 4 жыл бұрын
did you solve it? same problem mee too. {% if page_obj.number==num %} show this column error
@ogbuchiarinze2557
@ogbuchiarinze2557 4 жыл бұрын
Hey, I am getting this same error, did you solve it ?
@Meme_Science
@Meme_Science 4 жыл бұрын
I was missing a quotation mark around the '-3' and '3' in ``` page_obj.number|add:'-3' ```
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 62 МЛН
Муж внезапно вернулся домой @Oscar_elteacher
00:43
История одного вокалиста
Рет қаралды 7 МЛН
Thank you Santa
00:13
Nadir Show
Рет қаралды 50 МЛН
Python Django Tutorial: Full-Featured Web App Part 3 - Templates
45:45
Python Django Pages, URLs & Slugs
20:55
Dave Gray
Рет қаралды 10 М.
Python Django Forms tutorial
26:54
Dave Gray
Рет қаралды 12 М.
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 62 МЛН