Dynamic URL Routing & Templates | Django (3.0) Crash Course Tutorials (pt 9)

  Рет қаралды 116,244

Dennis Ivy

Dennis Ivy

Күн бұрын

Пікірлер: 134
@DennisIvy
@DennisIvy 5 ай бұрын
Don't forget to check out my Complete Django course! dub.sh/NvGboTI
@shahbozabdullayev5583
@shahbozabdullayev5583 4 жыл бұрын
That was my biggest question: a particular dynamic single page for every item. And I got answer after this video. Thanks a lot !!! You are the treasure we must keep!
@DennisIvy
@DennisIvy 4 жыл бұрын
Glad it was helpful!
@DemocracyHasNoBias
@DemocracyHasNoBias 4 жыл бұрын
@@DennisIvy Honestly, you helped me a lot with this question as well! Thanks)))
@din_deorwine
@din_deorwine 4 жыл бұрын
That was my biggest question too!
@frassettiguido
@frassettiguido 3 жыл бұрын
@@DennisIvy I cant solve this issue, anybody help? "Reverse for 'customer' with no arguments not found. 1 pattern(s) tried: ['customer/(?P[^/]+)/$']" ; using // , when i comeback into the home page, that raise up
@Sapkaal
@Sapkaal 4 жыл бұрын
Best channel on KZbin for Django
@DennisIvy
@DennisIvy 4 жыл бұрын
:)
@hasantareq9394
@hasantareq9394 3 жыл бұрын
This is so far the best tutorials ever man!!!!!!!!!!!!!!! And its free!!!!!!!!!!!! Big respect from BANGLADESH
@muhammadyaseenkhan9875
@muhammadyaseenkhan9875 4 жыл бұрын
Far better than All udemy courses keep it up 🔥
@Chinmay_395
@Chinmay_395 4 жыл бұрын
The Best Tutorial!!!
@DennisIvy
@DennisIvy 4 жыл бұрын
Thank you!
@darkman8939
@darkman8939 5 жыл бұрын
well explained, Thanks again for sharing ur knowledge. Making crash course with a project is a great idea better than explaining stuff separately
@DennisIvy
@DennisIvy 5 жыл бұрын
I totally agree. I can have a concept explained to me but its not until I can put it into practice when I understand it.
@aboulfathfekri4044
@aboulfathfekri4044 Жыл бұрын
Thanks a lot , this is the best way of teaching I had seen, You are the treasure we must keep!❤👌🌹
@musangealain7556
@musangealain7556 4 жыл бұрын
Dennis Ivy you are the best
@juneyou9207
@juneyou9207 4 жыл бұрын
Thanks Dennis. your course is better than Udemy django course👏😏
@allivecars
@allivecars 4 жыл бұрын
thanks man, definitely the best tutorial ever, had so much fun
@akhror-oshie
@akhror-oshie 4 жыл бұрын
I found it very useful I just enjoyed understanding from your explanation, Thanks so much and will wait such courses again!
@ronilpatel7003
@ronilpatel7003 4 жыл бұрын
count value of number of orders for a particular customer can be rendered out with {{ orders.count }} here orders being the querySet. This would avoid use of extra variable named orders_count which is now being passed in the context variable.
@nischalbista5381
@nischalbista5381 2 жыл бұрын
Thank you Dennis! This course is really helping me a lot.
@tiagotitericz3654
@tiagotitericz3654 4 жыл бұрын
@Dennis Ivy thank you so much for this crash course, that's awesome!!! I'm just facing a problem!!! After I code the pk method I can't request the standard path cutomer/ anymore. When I request any id the url call the correct view, but when I request only customer/ I can't match any url Folllow the error below: Using the URLconf defined in fp.urls, Django tried these URL patterns, in this order: admin/ products/ customer/ The current path, customer/, didn't match any of these.
@aslamkhan-xd1jz
@aslamkhan-xd1jz 3 жыл бұрын
Same here did u solve it?
@tiagotitericz3654
@tiagotitericz3654 3 жыл бұрын
@@aslamkhan-xd1jz not yet, I’m trying to read django doc to find it out
@Raul-tw2xx
@Raul-tw2xx 3 жыл бұрын
@@tiagotitericz3654 Hey , did you figured out ?
@tiagotitericz3654
@tiagotitericz3654 3 жыл бұрын
@@Raul-tw2xx not yet, If I get it I’ll tell you 😉
@keshavjha9835
@keshavjha9835 4 жыл бұрын
Thank you Dennis for this great course. It is helping me a lot.
@_swordancer_
@_swordancer_ 4 жыл бұрын
I don't get one thing, in Order class we set customer.ForeignKey() so that Customer was a parent to the Order and we can call in views.py customer.order_set.all() but we did the same with Product and yet in 05:47 we set {{ order.product.category }} so now Order is a parent to the Product ?? It works both ways or am I missing something ??
@elonmusk2142
@elonmusk2142 4 жыл бұрын
i dont understand it too if have understand it so can u explain me please..
@johnmorgan2349
@johnmorgan2349 4 жыл бұрын
You use {{order.product.category}} if you are accessing the parent model, and customer.order_set.all() when trying to get the child model.
@abdulqadar9580
@abdulqadar9580 Жыл бұрын
You are amazing Dennis
@binaryreliantmind1611
@binaryreliantmind1611 4 жыл бұрын
@6:39 my table is empty. I followed the steps correctly and can't figure out why its not working. I tested it by replacing the for loop with plain text and it showed up. But the orders aren't passing through. I have a populated database with orders.
@drcod3r329
@drcod3r329 4 жыл бұрын
we can directly call the order_set in the template without creating a new variable and pass it to the context like order in customer.order_set.all
@srinivaspendem2826
@srinivaspendem2826 4 жыл бұрын
I am getting an error when I call order_set.all(). "function' object has no attribute 'order_set' ". I am getting this error, what should I do? any suggestions, please!
@matildaghanm6225
@matildaghanm6225 Жыл бұрын
@@srinivaspendem2826 iam getting the same error toooo 😭😭😭😭
@thomasrackow8159
@thomasrackow8159 5 жыл бұрын
Well done, good work. Only yesterday KZbin suggested your videos to me. Of course, I will follow your account. Appreciate Django content here. Just one thing, I think you should have done the dynamic url using as the pk will never contain any string.
@DennisIvy
@DennisIvy 5 жыл бұрын
I appreciate that Thomas :) And your right, "int" would be more appropriate here. I just really wanted people to understand that string values can be used in other situations, maybe like a blog name or something..
@grzegorz-gregmika8339
@grzegorz-gregmika8339 5 жыл бұрын
@@DennisIvy Please change id to uuid, it would be better and more relevant to the document DB and will survive ;-)
@DennisIvy
@DennisIvy 5 жыл бұрын
@@grzegorz-gregmika8339 That's how I normally do it but because I haven't covered uuid yet i kept it with the id. I'll probably add that as another video so I can cover the entire topic :)
@tilting_cat3344
@tilting_cat3344 4 жыл бұрын
@@DennisIvy Hey dennis i can still open the customer/1 page as i have customer with id =1 but when it came to show the output data it doesn't show up even the {{customer.name}} doesn't show up only the lay out of the page and nothing else
@tilting_cat3344
@tilting_cat3344 4 жыл бұрын
@@DennisIvy the thing is if it does not have any value it should return error right but it doesn't show any error i cna open the page but not one data output show
@kshitijsangar3151
@kshitijsangar3151 4 жыл бұрын
Hello Sir, at 0:56 you passed pk to the customer function like customer(request,pk), so my question is, when we give a call to this function, don't we have to pass the parameter pk? because you didn't mention any of that in here.
@looyeeng9946
@looyeeng9946 4 жыл бұрын
0:01 Dynamic URL routing 3:25 Queries & Rendering data to templates 8:35 What's next Note: www.notion.so/9-Dynamic-URL-Routing-Templates-b3611d6ad067484bbdeb947102a62e6e
@mohamedelmabrouki512
@mohamedelmabrouki512 4 жыл бұрын
This is awsome man. Thanks for sharing your knowledge for free
@tristanjayvirtudazo2268
@tristanjayvirtudazo2268 3 жыл бұрын
hi im a bit curious on how to use it in an tag in html. can you show me? i would deeply appreciate it
@dhairya-varshney
@dhairya-varshney 2 жыл бұрын
Helped me in my project. Thanks for the video buddy.
@ΒασίληςΖ-σ4υ
@ΒασίληςΖ-σ4υ 4 жыл бұрын
Hi Dennis, Nice Job. I am facing this error : type object 'Customer' has no attribute 'object'. I had check my code so far line by line compare it with yours but i could not find something. At my "views" i am importing : "from .models import *" but seems that ignore it. Any help. I must inform you that so far the code was running (until this tutorial). The problem occured when i changed this line "path('customer//', views.customer),". Thanks Again.
@devpaccy
@devpaccy 4 жыл бұрын
@Vladimir Terentev hello! I tried to use this but I can't figure out, how did you use that code? Thank you!
@stephenchege
@stephenchege 4 жыл бұрын
I am getting an error at 2:28 when I refresh my browser Page not found (404) Request Method: GET Request URL: 127.0.0.1:8000/2/ Using the URLconf defined in crm1.urls, Django tried these URL patterns, in this order: admin/ products/ customer// The current path, 2/, didn't match any of these. You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page. When I set debug to False I still get an error .... can anyone help me with this?
@immanuelpaul9421
@immanuelpaul9421 4 жыл бұрын
after doing runserver, 127.0.0.1:8000/customer/2/ give this i think you have forgot to give primary key value /2/ or etc.....
@felmangarcia1274
@felmangarcia1274 4 жыл бұрын
Thank you so much! The best tutorial ever!
@abinashdutta2109
@abinashdutta2109 4 жыл бұрын
I'm confused about 'order_set', 4:17 , can you please mention where u have introduced it?
@rijalefendi6465
@rijalefendi6465 4 жыл бұрын
u can check Database Model Queries in previous video
@matildaghanm6225
@matildaghanm6225 Жыл бұрын
@@rijalefendi6465 iam getting the same error too ...please help
@banaras.wala.foreignaala
@banaras.wala.foreignaala 4 жыл бұрын
Dear Dennis, thanks for making such good videos. Thanks,
@Magistrado1914
@Magistrado1914 4 жыл бұрын
Excellent course 13/07/2020
@talhasaleem8333
@talhasaleem8333 4 жыл бұрын
how can i redirect to a dynamic url
@moanxion9102
@moanxion9102 2 жыл бұрын
If yall get this error "object is not iterable" use filter() instead of get()
@brunomandela3480
@brunomandela3480 Жыл бұрын
what if i get an error like NoReverseMatch at /students/3/ what should i do now
@paulo25740
@paulo25740 3 жыл бұрын
thanks mate exactly what I needed
@bishaladhikari8691
@bishaladhikari8691 2 жыл бұрын
i want individual customer ,order date ,status table in single page how can i do that ?
@syedrayyan8130
@syedrayyan8130 4 жыл бұрын
it unable to load css files and image files while passing pk_test string...please help me with this Refused to apply style from '127.0.0.1:8000/product-details/3/static/css/bootstrap.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
@tic-tac-toe7473
@tic-tac-toe7473 4 жыл бұрын
What if i want to search the customer from form input field..how can redirect that url
@hamzaseif4992
@hamzaseif4992 4 жыл бұрын
thanks alooot for these videos really helpfull ♥
@doniyorabduvokhidov1706
@doniyorabduvokhidov1706 4 жыл бұрын
Wow... This was really amazing .
@rutviktak716
@rutviktak716 4 жыл бұрын
U r awesome😘 I mean i'm really getting a hang of this and it's so much fun😊
@singhgangadhar1683
@singhgangadhar1683 4 жыл бұрын
i have been completing the course from first but i got an error// The current path, customer/, didn't match any of these.// i tried every thing can u plz help me
@abhishek.p6825
@abhishek.p6825 4 жыл бұрын
check your url.py file. You would have made some mistake there..
@tiagotitericz3654
@tiagotitericz3654 4 жыл бұрын
Did you solve it? I'm facing the same problem. After I code the pk I can't request the standard cutomer/ anymore. When I request any id the url call the correct view, but when I request only customer/ I can't math any url Folllow the error below: Using the URLconf defined in fp.urls, Django tried these URL patterns, in this order: admin/ products/ customer/ The current path, customer/, didn't match any of these.
@shaziyaakhtar4437
@shaziyaakhtar4437 3 жыл бұрын
@@tiagotitericz3654 did you solve it? As i m facing the same issue.
@doniyorabduvokhidov1862
@doniyorabduvokhidov1862 4 жыл бұрын
Wow enjoy watching ur totorials
@manastiwari2250
@manastiwari2250 3 жыл бұрын
this tutorial is so so good it has helped me alol
@MilaBarross
@MilaBarross 3 жыл бұрын
That is awesome!! Thanks!
@tamarapetrova8440
@tamarapetrova8440 Жыл бұрын
The link to the source code is not working. Could you please fix this, Dennis?
@SumitKumar-js3po
@SumitKumar-js3po 4 жыл бұрын
Urgent answer please! i want to grab the loggedin user user_id . model is --> Profile (user,email,pic,website)
@chancewatkins5071
@chancewatkins5071 2 жыл бұрын
Very nice tutorial, exactly what I was looking for. Thanks; I've subscribed. God Bless. : D
@davidbrown2806
@davidbrown2806 4 жыл бұрын
FYI .... I noticed that line 10 in customer.html is missing {{ customer }} to put the customer name in the top left panel. Cheers
@jacobidoko3009
@jacobidoko3009 4 жыл бұрын
i am following the tutorial and on this particular video i keep getting an error that says:'Customer' object has no attribute 'order_set'.
@garryg5044
@garryg5044 4 жыл бұрын
I know how frustrating it can be. And I am having my share of errors as well. Just download the source code and compare it to yours. It is tedious work but it will help you.
@kevinobrien6770
@kevinobrien6770 4 жыл бұрын
Hi Jacob, this can happen depending what IDE you are using. I was using PyCharm Community Edition 2018 and had this issue. Once I updated to the 2020 it was fixed. I believe it has to do with the level of support for Django within the IDE.
@gaurabdawadi1907
@gaurabdawadi1907 4 жыл бұрын
Maybe you have different class name for order model . Something like class OrderModel() instead of class Order() ,but while writing query you have used order_set.
@muhammadismail8230
@muhammadismail8230 4 жыл бұрын
i had the same error, my mistake was i wrote order.set instead of order_set. Check ur code.
@kakego3002
@kakego3002 2 жыл бұрын
i reading this comments but no one say if u named ur class CustomerModel u need to use ordermodel_set
@meleniogaray5109
@meleniogaray5109 4 жыл бұрын
I have a problem with the contact information the email and phone do not appear on my website. can you help me with that?
@gg-vl2xw
@gg-vl2xw 4 жыл бұрын
do you find the solution?
@Sn4c0803
@Sn4c0803 4 жыл бұрын
I am getting an error can you help me out. Its saying customer() got an unexpected keyword argument 'pk_test'
@gg-vl2xw
@gg-vl2xw 4 жыл бұрын
do you find the solution?
@julianbazanaguirre8439
@julianbazanaguirre8439 4 жыл бұрын
please show us ur code, if you just say that, could be many things, apparently is something with pk_test check that is the same in all places. One of the skills of a programmer is to debug his/her own code, so, give it a try next time. Try to go back and forth, change things, double check that all the things are written correctly, possible copy the error and look for it in stackoverflow or github, for sure someone had the same error than u did. Let me know later! this is my views.py def customer(request, pk_tes): #customer = Customer.objects.get(id=pk_test) return render(request, 'accounts/customer.html') this is my urls.py urlpatterns = [ path('', views.home), path('products/', views.products), #make path dynamic by adding
@dimitrioschamarousios1131
@dimitrioschamarousios1131 4 жыл бұрын
You must add pk_test as parameter at customer in views.py
@shreymodi7519
@shreymodi7519 4 жыл бұрын
@@julianbazanaguirre8439 def customer(request,pk_test) change it to this
@KrishnaManohar8021
@KrishnaManohar8021 4 жыл бұрын
bro make tutorial about import UUIDField
@Bawaromerali
@Bawaromerali 4 жыл бұрын
great video , thanks .
@davidbrown2806
@davidbrown2806 4 жыл бұрын
In line 9 of customer.html he missed including {{customer.name}} to complete the form.
@amanchaurasia9880
@amanchaurasia9880 4 жыл бұрын
getting attribute error in customer page
@shaneebkottakkal3491
@shaneebkottakkal3491 3 жыл бұрын
i dont undserstand order_set pls help me
@Ab-gf8pz
@Ab-gf8pz 3 жыл бұрын
in Order model class Order(models.Model): choice=(('Pending','Pending'), ('Out of stock','Out of stock'),('Delivered','Delivered')) customer=models.ForeignKey(Customer,on_delete=models.CASCADE,null=True,related_name="customer") product=models.ForeignKey(Product,on_delete=models.CASCADE,null=True,related_name="product_order") added=models.DateTimeField(auto_now_add=True) status=models.CharField(max_length=200,choices=choice) in views.py def customer(request,pk): customer=Customer.objects.get(pk=pk) ##reverse relationship of Customer and Order shown in Order - customer ## customer.related_name orders=customer.customer.all() context={'customer':customer, 'orders':orders } return render(request,"Accounts/customer.html",context)
@danielampey9131
@danielampey9131 4 жыл бұрын
Well explained...
@palanikumar8023
@palanikumar8023 4 жыл бұрын
orders=customer.order_set.all() showing error for me..plz help me sir..
@aarushihans1924
@aarushihans1924 4 жыл бұрын
hey, its showing me the same error, did you find any solution to it?
@BrandonDelPozo
@BrandonDelPozo 4 жыл бұрын
How can I create a personalized URL for every user, for example I have this: www.mywebsite.com/profile and I want something like this www.mywebsite.com/user... I mean www.mywebsite.com/john, www.mywebsite.com/luisa etc. How can I do that?
@frassettiguido
@frassettiguido 3 жыл бұрын
I cant solve this issue, anybody help? "Reverse for 'customer' with no arguments not found. 1 pattern(s) tried: ['customer/(?P[^/]+)/$']" ; using // , when i comeback into the home page, that raise up @Dennis Ivy
@farsanaks5672
@farsanaks5672 3 жыл бұрын
hi sir i have one error can you help me
@waqarshaikh716
@waqarshaikh716 3 жыл бұрын
Is your error solved?
@farsanaks5672
@farsanaks5672 3 жыл бұрын
@@waqarshaikh716 no could you hel me
@waqarshaikh716
@waqarshaikh716 3 жыл бұрын
@@farsanaks5672 Sure, I'll try to help you.
@farsanaks5672
@farsanaks5672 3 жыл бұрын
@@waqarshaikh716 i try to write a ecommerce project.the problem is when the project is run first web page is showed but when i click on login and register button that redirect home page. and i try to find the bug but it shows no module named django.but i already install django and use the command pip install django also
@waqarshaikh716
@waqarshaikh716 3 жыл бұрын
@@farsanaks5672 In you Command Prompt or Terminal run this command `pip list`. This command will list all the python packages installed in your PC. Check if you have Django in that list.
@anushribarsaiyan8302
@anushribarsaiyan8302 4 жыл бұрын
Thankq so much..................:)
@ahmedkadry3512
@ahmedkadry3512 4 жыл бұрын
plz whare in find attribute order_set thanks
@AshuSingh-mw2wt
@AshuSingh-mw2wt 4 жыл бұрын
stackoverflow.com/questions/42080864/set-in-django-for-a-queryset
@shaziyaakhtar4437
@shaziyaakhtar4437 3 жыл бұрын
"GET /customer/ HTTP/1.1" 404 2490 Not Found: /customer/ , this is the error I m getting, every page is getting open admin,about,dashboard,product but customer page is not opening at all ,, if anyone knows how to solve this error ,kindly let me know ..
@KevinTempelx
@KevinTempelx 4 жыл бұрын
ty
@EOO-Stand
@EOO-Stand 4 жыл бұрын
excellent teaching, do you have a paypal account where people can buy you coffee. i have seen a few youtube videos with accounts.
@saeedou
@saeedou 4 жыл бұрын
share the codes please
@DennisIvy
@DennisIvy 4 жыл бұрын
Already linked.
@saeedou
@saeedou 4 жыл бұрын
@@DennisIvy got it and thank you for this great course .
@matildaghanm6225
@matildaghanm6225 Жыл бұрын
@@DennisIvy the link doesn't work
@brunomandela3480
@brunomandela3480 Жыл бұрын
pliz answer urgently
@srinivaspendem2826
@srinivaspendem2826 4 жыл бұрын
I am getting an error when I call order_set.all(). "function' object has no attribute 'order_set' ". I am getting this error, what should I do? any suggestions please
@srinivaspendem2826
@srinivaspendem2826 4 жыл бұрын
def customer(request, pk_test): customers = Customer.objects.get(id=pk_test) orders = customer.order_set.all() context = {'customer':customer,'orders': orders} return render(request, 'accounts/customer.html', context)
@jorgecosta1758
@jorgecosta1758 4 жыл бұрын
@@srinivaspendem2826 same problem here
@matildaghanm6225
@matildaghanm6225 Жыл бұрын
@@jorgecosta1758 me tooooo
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Try DJANGO Tutorial - 13 - URL Routing and Requests
5:38
CodingEntrepreneurs
Рет қаралды 40 М.
Why Agent Frameworks Will Fail (and what to use instead)
19:21
Dave Ebbelaar
Рет қаралды 101 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН