Rendering Data to Templates | Template Tags | Django (3.0) Crash Course Tutorials (pt 8)

  Рет қаралды 128,627

Dennis Ivy

Dennis Ivy

Күн бұрын

Пікірлер: 134
@DennisIvy
@DennisIvy 5 ай бұрын
Don't forget to check out my Complete Django course! dub.sh/NvGboTI
@johntwalkerv1647
@johntwalkerv1647 4 жыл бұрын
Just getting into these after digging through some other tutorials. Got to say, these are the best I've seen by far! I found your "I sold my Django app" video, and searched your uploads to see this. Great job! Thank you for your efforts here!
@cesaralvarez9436
@cesaralvarez9436 4 жыл бұрын
The same as I, Dennis is a really good teacher.
@jakobfredriksson2272
@jakobfredriksson2272 4 жыл бұрын
My young intelligent man, THANK YOU! It's astonishing how hard it has been finding a simple, yet brilliant, tutorial like this one. I'm actually quite confident in python programming in general but since I began to learn Django (or web development in general) this summer I've been completely lost due to the logic -the relationship - between views, templates and models. Yes, I've read the docs quite a lot but find them inconsistent in some regards but after this tutorial most, if not all, of my frustration disappeared. Wish you all the best!
@rachiddz8656
@rachiddz8656 4 жыл бұрын
I was about to give up. I came back again after watching Ivy's videos. Thanks bro.
@abhishekk1231
@abhishekk1231 4 жыл бұрын
I have watched several tutorials on Django, but these are the best of all!!
@aayushmusic6911
@aayushmusic6911 4 жыл бұрын
Best Django tutorial so far, detailed and understandable, thank you for making this videos, appreciate a lot man
@tanmoysarkar3714
@tanmoysarkar3714 4 жыл бұрын
learned so efficiently. No messy code ,clean and easy to understand. Thank You
@ramirezjuan0715
@ramirezjuan0715 4 жыл бұрын
Great tutorial. Best one I've found yet. Thank you, Dennis!
@DennisIvy
@DennisIvy 4 жыл бұрын
My pleasure Juan! and thanks for the comment :)
@gersoninthekitchen6656
@gersoninthekitchen6656 4 жыл бұрын
@@DennisIvy you are the best, I love you for your courses, I am really learning with them.
@rakkaalhazimi3672
@rakkaalhazimi3672 5 жыл бұрын
The things got more complicated from the time to time. But Im really eager to learn from your videos. Never expect to get known of the html, bootstrap, css and javascript things. Im glad you covered those things and explained them concisely from the begining.
@DennisIvy
@DennisIvy 5 жыл бұрын
Keep up the hard work Rakka, so glad my videos are helping :)
@bavan1358
@bavan1358 3 жыл бұрын
I've taken a lot of tutorials which just wasted my time, this tutorial was helpful and on point.
@purplejelly24
@purplejelly24 3 жыл бұрын
I was having a hard time making sense of Django but you made it really easy! Thank you for this! :)
@akatiga72
@akatiga72 2 жыл бұрын
Better than many paid tutorials in Udemy. Double thumbs up!!
@barelycodingtoday
@barelycodingtoday Жыл бұрын
I learned a whole lot from just this one video. Thanks fam.
@akmalatkhamov5553
@akmalatkhamov5553 4 жыл бұрын
Dennis, thanks a lot for your effort and dedication! Great tutorial with clear explanations of core concepts. I have got a suggestion)) It would be great if there would be a video tutorial which shows how to render data from 2 database tables, which have the one-to-many relationship, into one table on the webpage (it would be great if custom-template tags could also be covered)
@zakkuajizu318
@zakkuajizu318 4 жыл бұрын
well explained and solved many of my problems.. appreciate the effort Dennis.
@AviralJain
@AviralJain 4 жыл бұрын
Sir I am facing issues on products = Product.objects.all() That is showing "Class 'Product' has no 'objects' member" Please help me !
@elnazdehkharghani6121
@elnazdehkharghani6121 4 жыл бұрын
me too , if you find it out please let me know where the problem is
@arafkarim
@arafkarim 4 жыл бұрын
@@elnazdehkharghani6121 It's a VS Code's problem. You can leave it like that because your code is ok, it'll work fine. I did this. Or you can change your editor Or you can find other solutions here - stackoverflow.com/questions/45135263/class-has-no-objects-member
@caohuyphuong
@caohuyphuong 4 жыл бұрын
Products.objects.all(). you omit s
@alvinaa2306
@alvinaa2306 4 жыл бұрын
​@@caohuyphuong​I have the same error the code is not working too Please help !
@LetItRoll_L
@LetItRoll_L 4 жыл бұрын
add ----------------- orders = Order.objects.all()-------------- inside-------------------------- def home(): -------class------------------ works fine.
@amjadhussain2398
@amjadhussain2398 4 жыл бұрын
Very helpful dennis!! Gave me solid grasp of template logics Thanks again
@angtranhai6457
@angtranhai6457 4 жыл бұрын
Yep, best tutor so far. Thanks a lot :)
@fedouafedd1275
@fedouafedd1275 4 жыл бұрын
thank you so much .you really helped me in my project .your manner of explain is very simple and easy to follow
@itglobal8826
@itglobal8826 5 жыл бұрын
Bro you explain very very good. Thank you!
@DennisIvy
@DennisIvy 5 жыл бұрын
Thank you!
@a0159arun
@a0159arun 4 жыл бұрын
Hi Dennis, why in views.py its saying like Costumer, Product, Order is not defined. This kind of error comes often. pls look into this
@musangealain7556
@musangealain7556 4 жыл бұрын
All your videos helped me a lot to know django. Keep it up
@din_deorwine
@din_deorwine 4 жыл бұрын
De los mejores cursos que he visto.
@subpxll
@subpxll 4 жыл бұрын
Thanks, Dennis for making this tutorial. kudos
@issamohammed3529
@issamohammed3529 4 жыл бұрын
I believe that you have a high skill to teaching
@collinslee4383
@collinslee4383 4 жыл бұрын
This is awesome django tutorial! Im appreciated for uploading your video.
@nahidosen
@nahidosen 3 жыл бұрын
You just saved my life. Thanks
@amazonfbaphotographer7333
@amazonfbaphotographer7333 4 жыл бұрын
What I don't understand is how you decide to place "for example" the code for total orders, pending order, etc in the views.py section/file. I guess it's obvious so everything is organized, but still, have trouble understanding the decision-making on naming the files. Thank Dennis, learned a lot in these past days of going through your channel and courses!
@christianvillegas3063
@christianvillegas3063 4 жыл бұрын
too many values to unpack (expected 2) the peding and delivered variables..help me
@ravidagdi5099
@ravidagdi5099 4 жыл бұрын
use column name instead of direct value. like same as total_delivered = orders.filter(status='Delivered').count()
@Zeeshantariqpkn
@Zeeshantariqpkn 2 жыл бұрын
I got an error ValueError at / too many values to unpack (expected 2) in part 8 while fetching the delivered = orders.filter('Delivered').count() pending = orders.filter('Pending').count()
@mamusthafa6
@mamusthafa6 4 жыл бұрын
Understood clearly Well explained 😊
@billywilliamvanheerden8558
@billywilliamvanheerden8558 4 жыл бұрын
Thanks for the awesome tutorials man.
@chakravarthi3438
@chakravarthi3438 4 жыл бұрын
bro i got an error in home page like 'function' object has no attribute 'objects' when i add customers=customer.objects.all() can you plz help me
@aaudhachhabria7491
@aaudhachhabria7491 4 жыл бұрын
I am also getting same error,
@josebobin2162
@josebobin2162 4 жыл бұрын
@@aaudhachhabria7491 customers=Customer.objects.all()
@ravidagdi5099
@ravidagdi5099 4 жыл бұрын
model name is case sensitive so use Customer instead of customer
@Maia35-A
@Maia35-A 4 жыл бұрын
Thank you. can you Post the link of the video that Expalins how to render the amount of orders for each customer !
@kaimodar8639
@kaimodar8639 4 жыл бұрын
Hi, did you figure it out in the end? I just went through the course and it's still missing :)
@vivekmogalla5267
@vivekmogalla5267 Жыл бұрын
Hi Denis, this is very useful , But I have one doubt, In rendering data to templates, I passed the data to status template with all total_orders, orders_delivered, orders_pending, but I am not able to display those values, what ever value i am passing to the template, I am not able to see the values in the template
@muditsingh4191
@muditsingh4191 4 жыл бұрын
i was juz curious and wanted to know how did u learn django and everything related to it. Would be grateful if u could answer that. Thanks Dennis for the tutorial, it really helps. GBU
@v.karikaran5973
@v.karikaran5973 4 жыл бұрын
me to very curious
@louzynerd129
@louzynerd129 4 жыл бұрын
0 dislikes, just the way I like it !
@sushantpawar6096
@sushantpawar6096 4 жыл бұрын
After running for loop in the Order oobject I cant fetch the details in the dashboard
@ronanamelin
@ronanamelin 4 жыл бұрын
Really good one . Have a question here though - how would we change the height of the raws ? The width would be 12 from what In understood , but I`ve tried standard html editing for the rows ( ) and didn`t work really ).
@joaofranca2678
@joaofranca2678 4 жыл бұрын
Hi, Dennis! First of all thanks for this awesome course! I have a question, let’s say after a series of orders, we update a product's price in the Product Model. It would also affect all of our past orders, isn't that right? How can we go around that? Thanks again!
@hamidheyhat5509
@hamidheyhat5509 4 жыл бұрын
Dennis, Thank you for the great tutorial, I have a question how we can have a for loop in a table from two or more model, Let's say we have a table and we like to have a product name and customer name and order status on it. Thank you again.
@marekwaligora1527
@marekwaligora1527 4 жыл бұрын
Great material... I'm really impressed . It is very helpful
@dassouki
@dassouki 4 жыл бұрын
HI Dennis, great tutorial and thoroughly enjoying it. Curious to know how would you show show the name of a foreign key instead of its Class_ID_value
@GeeksRedefined
@GeeksRedefined 3 жыл бұрын
is it important to create and write query as u have written as Demosquery??
@kalenzo78
@kalenzo78 5 жыл бұрын
great effort continue with the series boss
@DennisIvy
@DennisIvy 5 жыл бұрын
Uploading now :)
@shubhamgoel2774
@shubhamgoel2774 4 жыл бұрын
I am unable to add tags to the products. I also cannot add tags because it won't show in admin panel. Please help! I have added the Tag class to model.
@redwolffire408
@redwolffire408 4 жыл бұрын
How can I use SQL commands to retrieve, update and delete data in django?
@fordhenriod7383
@fordhenriod7383 4 жыл бұрын
Thanks so much for this so informative materials i just have one question in template data example {{data.id}} can it span across multiple related table being some reverse relationships {{Product.Customer,Country.City.City_population)
@komilyaxshilikov5729
@komilyaxshilikov5729 4 жыл бұрын
Bro your skill is very good , i liked your courses .If you upload API rest framework courses, i think it will be amazing job for us your followers and your students , thank you .
@leeyeehao6157
@leeyeehao6157 3 жыл бұрын
really good content! learnt a lot from you, thank you so much!
@rayganmudberry375
@rayganmudberry375 5 жыл бұрын
Just awesome!
@kinkinds
@kinkinds 3 жыл бұрын
and jhonsnow is handsome
@rushabhmehta6898
@rushabhmehta6898 4 жыл бұрын
Not getting orders name.... In return showing order object (1) and so on
@mohammedal-asadi1051
@mohammedal-asadi1051 4 жыл бұрын
i did the same thing that you did but it shows me that ('function' object has no attribute 'count') plz help me to solve this problem i am stuck at it :(
@parashv2185
@parashv2185 4 жыл бұрын
Hi Dennis, can you help me out with the way that we can actually see total number of orders for each customer in home page. Looks like that was your initial plan on this video but since we have to use model method for that you skipped it... i would appreciate your input on this
@kaimodar8639
@kaimodar8639 4 жыл бұрын
Hi, did you figure it out in the end? I just went through the course and it's still missing :)
@abhishekg2307
@abhishekg2307 Жыл бұрын
I'm not able to access the source code, could someone please help? it shows Application Error and in console its 503 error
@rushikeshsusar8329
@rushikeshsusar8329 4 жыл бұрын
Type object Customers has no attribute 'count' attribute error coming can anyone help
@ibxmahmood8367
@ibxmahmood8367 4 жыл бұрын
Hi Eng.Dennis I have some issue according to Query Set : once I try as per you above tutorial to rendering data to Template and also I already imported the data using by Shell like this way : from motor.models import* vehicle = Cars_details.objects.all() print(vehicle) it will show all the data from table and I don't have any issue. but when I rendering data to Template it not show and I get message mentions : AttributeError at /Cars_details/ 'function' object has no attribute 'objects' Request Method: GET Request URL: 127.0.0.1:8000/Cars_details/ Django Version: 3.0.7 Exception Type: AttributeError Exception Value: 'function' object has no attribute 'objects' Exception Location: C:\Users\Administrator\Desktop\carsystem\motor\views.py in Cars_details, line 14 Python Executable: C:\Users\Administrator\AppData\Local\Programs\Python\Python38\python.exe Python Version: 3.8.3 Python Path: ['C:\\Users\\Administrator\\Desktop\\carsystem', 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python38\\python38.zip', 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python38\\DLLs', 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python38\\lib', 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python38', 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-pack so plz can you solve it for me > thanks
@supersonic_penguin
@supersonic_penguin 2 жыл бұрын
for those who have trouble with order when implementing them in dashboard.html, ,make sure that you migrated all the changes and write the correct name. i've been struggled with that for 30 minutes lol
@rafianshaikh62
@rafianshaikh62 4 жыл бұрын
Dennis how we can relate two models to a single class based view ? Can any one help
@jakuboawelski
@jakuboawelski 4 жыл бұрын
Just awesome! Thank You!
@AliRaza-yk5ic
@AliRaza-yk5ic 4 жыл бұрын
Thank you so much sir.Great Work
@alielahi2712
@alielahi2712 4 жыл бұрын
This was Great ! Thank you.
@AndreaManna85
@AndreaManna85 3 жыл бұрын
Hey Dennis, i'm stuck and really i don't know why. When i set on views orders and customers with ***.objects.all(), i get this error "Exception Value: 'function' object has no attribute 'objects'". Maybe is something stupid, but i cannot understand where's my mistake.
@deepanshudutta4443
@deepanshudutta4443 3 жыл бұрын
Just check which model gave that error then Just change the model name,it conflicts on the naming convention,so just change the model name.💯 Fix.I fixed it in that way.
@francisopogah363
@francisopogah363 3 жыл бұрын
@@deepanshudutta4443 please explain more
@shashankpandey1966
@shashankpandey1966 3 жыл бұрын
sir ,all the queries u have written in views.py like total_customers =customers.count()...is these queries are same if i changed the database..let say mongoDB.?
@mokk7134
@mokk7134 3 жыл бұрын
mongo isnt sql database so possibly there are other queries
@rababmahdi2920
@rababmahdi2920 5 жыл бұрын
delivered = orders.filter(status="Delivered").count() would you please explain this line of code once again? specially this:- status="Delivered".
@DennisIvy
@DennisIvy 5 жыл бұрын
So because we are using the "filter()" method instead of "all()" we can filter by the "Order" models "status" attribute. So we are saying "Give us all orders that have the value of "Delivered" in the status field." Then because "orders.filter(status="Delivered")" returns a queryset/list with all the orders containing the status of "Delivered" we can use the count method to total up how many orders are in that queryset/list and return the total number. Its the equivalent of running the python len() method on a list. Does that make sense?
@rababmahdi2920
@rababmahdi2920 5 жыл бұрын
@@DennisIvy status is an attribute from Order models..yeah i got it now..thanks a lot..
@DennisIvy
@DennisIvy 5 жыл бұрын
Rabab Mahdi awesome :)
@billywilliamvanheerden8558
@billywilliamvanheerden8558 4 жыл бұрын
Hey Dennis, how do I get my Last 5 orders to display only the last 5? I have about 15 orders in the table to test but I can't seem to figure out how to only display the last 5 orders in the table. Thanks for the great videos!
@caohuyphuong
@caohuyphuong 4 жыл бұрын
orders = Orders.objects.all()[:5]. and in models you order_by date_created
@ravidagdi5099
@ravidagdi5099 4 жыл бұрын
you can user order by with query also to display
@fahanfarooq3844
@fahanfarooq3844 4 жыл бұрын
hey i tried using __str__(return self.customer ,self.product) in the Order class that worked just fine till now.Now, it shows type error (returned non string type "tuple") but without that chunk the code works fine! why so?
@tonyd9120
@tonyd9120 4 жыл бұрын
You can only return a string. In the order model both customer and product are foreign key references to their respective models. I haven't tried it but you could probably make it valid by using "return self.customer.name, self.product.name". This way it is a string as both the name fields are strings.
@fahanfarooq3844
@fahanfarooq3844 4 жыл бұрын
@@tonyd9120 still the same error !
@787ankur
@787ankur 4 жыл бұрын
You can convert them to string using string formatting def __str__(self): return f'{self.status}_{self.customer.name}_{self.product.name}'
@tanokidev8800
@tanokidev8800 4 жыл бұрын
nice tutorial. how to compute total price in costumer can you make some tutorial
@Magistrado1914
@Magistrado1914 4 жыл бұрын
Excellent course 12/07/2020
@suibaba
@suibaba 4 жыл бұрын
Thankyou sir for inspiration in programming nd i found an error while following your series plz help me to sort out As i define the path('customer//',views.customer,name='customer'), And error out to be current path,Customer/ didn't match any of these
@suibaba
@suibaba 4 жыл бұрын
While all other path are correct sir i m a newbie in django...
@suibaba
@suibaba 4 жыл бұрын
Even when i used in 127.0.01:8000/customer/2 its running but when i run the path only to customer it errors out
@mohamedfarah4441
@mohamedfarah4441 4 жыл бұрын
Thank you , very helpful tutorial
@djalan84
@djalan84 Жыл бұрын
Классный туториал
@kerifrias202
@kerifrias202 4 жыл бұрын
Exception Value: no such column: accounts_order.customer_id
@perfectigbadumhe113
@perfectigbadumhe113 4 жыл бұрын
Thanks very useful tutorial pls can you make the total count for customers or orders just display the count for the day or month or something instead just displaying the overall count thanks..... would be very grateful
@DennisIvy
@DennisIvy 4 жыл бұрын
I might do something like that after I close out the series :)
@ImranKhan-dx7fj
@ImranKhan-dx7fj 3 жыл бұрын
Hey Dennis! Thanks for the wonderful series. Really helped me a lot. Just wondering if you've already made a tutorial on how to render the number of orders against each customer (as was shown in the initial demo). Really looking forward to it. Thanks
@jodikurniawan3732
@jodikurniawan3732 4 жыл бұрын
very clear, thank you.
@avadhootshinde1150
@avadhootshinde1150 4 жыл бұрын
can any one help me for product template it gives "no such table" as error.
@dolfeyy
@dolfeyy 4 жыл бұрын
makemigrations first bro then migrate
@kumardeepanshu8503
@kumardeepanshu8503 4 жыл бұрын
I am having so may errors where I can ask you
@mezned
@mezned 4 жыл бұрын
Great .. thank you very much
@medoune89
@medoune89 4 жыл бұрын
I'm a laravel developer...... I wish a long time ago to learn Django, But it's possible with You... Thank for
@tanvirashraf728
@tanvirashraf728 4 жыл бұрын
what does your experience with both language say....does django seem easier and less complicated??
@medoune89
@medoune89 4 жыл бұрын
@@tanvirashraf728 so i have already some skills with Python but , I want to learn python to study data mining and AI. Now I develop with PHP and Laravel my applications. I want to increase my skills
@v.karikaran5973
@v.karikaran5973 4 жыл бұрын
Thank you sir
@MehmetAli-hd8bw
@MehmetAli-hd8bw 5 ай бұрын
Can someone share the cheat sheet with me?
@abubakrhartley959
@abubakrhartley959 4 жыл бұрын
Awesome
@iyonissiodanielsitoe1839
@iyonissiodanielsitoe1839 4 жыл бұрын
Good man
@zeajuniordev
@zeajuniordev 4 жыл бұрын
Thanks!
@Boilnardo
@Boilnardo 6 ай бұрын
perfect
@robertaristov614
@robertaristov614 4 жыл бұрын
Hi Dennis& Thank you so much for your tutorials. It helps me a lot. But you know, when z I start to code my project I faced with following problem. Sent few days in google, but didn't find anything. So if it is possible, will be very thankful if you can help me. I try to doo link in my table to database info, as in your video: {% for order in orders %} {{order.contract.client_contr.company_name}} And it is work. when try to get info from child table into Parent table, without any problem. But when I need to get the same result from parent table to Child, I can't do that. example: {{order.statusesorder_set.num_waybill}} I didn't get any info from it. I even try to use related_name and still didn't get any info This table StatusesOrder has ForeignKey to Orders class StatusesOrder(models.Model): order_stat = models.ForeignKey(Orders, null=True, on_delete=models.PROTECT, related_name='statorder') So I will be very thankful if you can give me advice!
@shafmairaj6493
@shafmairaj6493 3 жыл бұрын
products = Product.objects.filter this works products = Product.objects.filter.all() and this doesn't why?
@news0007
@news0007 2 жыл бұрын
Bro.. This course is not for beginners
@DennisIvy
@DennisIvy 2 жыл бұрын
Everyone has their own learning style. Funny thing is, I’ve been told it’s too basic from others. Find what fits you.
@axlblazeauthor
@axlblazeauthor 2 жыл бұрын
@@DennisIvy ayo dennis youre a savage lol
@sanskarkakde2552
@sanskarkakde2552 2 жыл бұрын
my number of orders delivered and pending is not updating and stucked on 1 since beginning need help
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
Django Skills Roadmap To Getting A Job
17:31
Dennis Ivy
Рет қаралды 70 М.
Google’s Quantum Chip: Did We Just Tap Into Parallel Universes?
9:34
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН