Mr Brian is a Brillant teacher and the build up of the lesson apps is awesome,No wonder they produce whole new level of brillant pass out students with the teaching faculty and clarity of subject like this.Thank you so much Harvard and the biggest gift of our time " The internet".
A very dense and totally meaningful course! Instead of wasting time on nonsense coding bootcamps (html, css, python and Django) here you see the total pure logic background and create totally generic pages, submit buttons that does something and things changes according to input... I loved and each 5 mins or so wanted to press on the like button (first time ever) :)))
Brian should have his own software development learning startup and expand the content not covered on cs50! He'll give a real treasure to this world and earn 100 of millions if not billions doing so!
Brian is the best online teacher for me. i connect with his way of teaching so much that i understand everything he teaches so easily. i don't think i've enough words to thank him for this. God bless Brian
Around 25 min, when you already have dedicated views for Brian and David then I think you should prioritize them in first and the generic greet view comes later only in defining URLs paths. This is not an error but makes different logical outputs. I am really thankful for your teaching.
I was procrastinating while learning Django alot nothing new always happens to me , I was learning by Dj docs tuned this course on I have been studying for like 4-5 hrs now Brian got me hooked mann literally I wish i had a ai bot like brian that explained me everything i needed to know in my life
31:28 render(request ,html page,context) 37:01 newyear app 43:36 python logic 48:00 static file 01:13:13 the info is posted to the same page we are in 01:34:00 no such table . error
I suppose the collision error, 1:10:08, was somewhat intentional to explain the next steps in those cases. But in this part 54:07 you can look at settings.py tasks is added at the end (after newyear) and at 54:13 urls.py tasks/ is NOT added at the end but before newyear/, hence the error. * I put tasks in both cases (settings.py and urls.py) after newyear and there was no error.
at 1:36:17 when Brian changes the add function to, instead of updating the (deleted) global variable, update the task list in the session - why are we using this syntax += [task] ? I know that the += is shorthand for append, but why is 'task' , that is obtained from the cleaned_data of the form and is a string, not simply appended to request.session["tasks"]] which is a list via the .append() method? If I use request.session["tasks"].append(task) it doesn't work. I'm trying to understand why..... request.session["tasks"] = a list task = a string I should be able to use the append method on the list to append the string. I'm clearly missing something here. Anyone that can explain this?
Made a stackoverflow question for this because it was bugging me and in the video Brian just 'acts like this is normal syntax' :) stackoverflow.com/questions/63449525/append-to-request-sessionslist-in-django/63477092#63477092
hey, when you use .append() the session by default won't be saved. Documentation here: docs.djangoproject.com/en/2.2/topics/http/sessions/#when-sessions-are-saved I'm not sure, but it seems the syntax Brian used gets around that and forces Django to save the session without having to explicitly say: request.session.modified = True.
hey, when you use .append() the session by default won't be saved. Documentation here: docs.djangoproject.com/en/2.2/topics/http/sessions/#when-sessions-are-saved I'm not sure, but it seems the syntax Brian used gets around that and forces Django to save the session without having to explicitly say: request.session.modified = True.
append(): This does not work request.session["tasks"].append(task) but this work list_tmp = request.session["tasks"] list_tmp.append(task) request.session["tasks"] = list_tmp : )
1:36:25 why it doesn't work if we utilize append like this??? request.session["tasks"].append(task), it only works if we write request.session["tasks"] += [task]
I had the same result and did some experimenting. It is certainly not random. Django seems to look in in the 'last url in the project's urlpatterns list' first. (lecture3/urls.py) In your lecture3 project 'urls.py', if you change the list as follows: urlpatterns = [ path('admin/', admin.site.urls), path('tasks/', include("tasks.urls")), path('newyear/', include("newyear.urls")), path('hello/', include("hello.urls")), ] so that 'hello' is last (recall that the hello APP also has a path with a name of 'index'). If you would now link to url 'index' - django will always go the index url of the hello APP. As you can see at 54:10 , Brian (probably on purpose to drive his point home later) puts the path for tasks BEFORE the newyear path in the urlpatterns list. You and I added it to the end of the list and as such we did not produce this problem. Having said all of that - it is good practice to name your apps so you can explicitly link to them.
There's a minimal logical error at the end since the "request.session[tasks]" only creates if the user goes first to the url "/tasks/", however if the user goes first to the url "/tasks/add" , the "request.session[tasks] is not created, so if the user tries to add a new task, it won't work. just a little observation, it was a great lecture
Yes, but add in def add(request): if "tasks" not in request.session: request.session["tasks"]=[] and this work fine! (if the user goes first to the url "/tasks/add")
How can he just do a lecture for nearly 2 hours straight with so much energy. I would fall asleep in the first 5 mins if I was him. Anyway I learnt alot from this lecture
I usually skip long videos but this thisss was totally worth it. a 1000 blessings to you. also whoever was in charge of the camera movements blew my mind.
1:21:50 but how would you add css to something that was written using Python, even worse how would you add bootstrap to that? I've searched a little and i have only found ugly code, i think that REALLY needed an explanation since raw html is unacceptable
1:09:00 when i open the tasks page it gives error set object not reversible and if i change {% url 'add' %} to [% url 'add' %] the index page opens but clicking the link gives a 404 error. I searched the internet and documentation and don't know what im doing wrong. Can someone help me?
With get request, if you typed your password in to a submit box, it would show you password in the url and that wouldn’t be good. But like a google search you can see what you typed in the url. Post allows to hide data like passwords
Hello, at 1:08:56 the href="{% url 'add' %}", and href="{% url 'tasks:add' %}", is not working. Has this been changed? Also, href="/tasks/add" works fine.
If the user at 1st visits the add function without visiting the index function it throws attribute error because tasks key in session dictionary is created in the index function !!
00:06:02 Django Project Setup
00:12:42 First View
00:14:19 Url setup
00:20:47 Additional Views
00:24:04 Parameterizing Views
00:27:22 Templates
00:43:40 If condition in templates
00:48:03 Using static files
00:53:39 Tasks App
00:58:29 For loop in templates
01:00:23 Adding tasks
01:02:39 Extending templates
01:09:45 Namespace Colision
01:14:22 CSRF verification
01:19:30 Django Forms
01:24:32 Form Validation
01:29:15 Django Redirect
01:31:09 Sessions
Not all capes wear heroes
@@johnjohn___ 😂wha-
No words to appreciate this type of content available for free! Thank you so much for such engaging content CS50 team!
1:11:53 - names collision
1:14:40 - CSRF verification failed
1:19:30 - Django's own ability to create forms
1:29:15 - Django redirect
#pointstolookup
Brian is brilliant teacher. I wish I could explain things like him in the future.
Great lecture. l had to pause in between for him to rest a bit.
loll
How very thoughtful of you
Wow brother 🤣🤣
😂😂😂😂
Definitely worthy of being Mr.Malans trustee he is getting all the Great teacher vibezz on him
really cs50 changed my life
You might learn to code from anywhere but if you really want to clear your concepts about what really is happening.. CS50 is a must
Are you referring to cs50x?
@@ObaidahNaseer yeah
Yep. I did 3 weeks of CS50x and it carried me through my first 2 years of coding in college. Coming back now many years later to try web dev
Mr Brian is a Brillant teacher and the build up of the lesson apps is awesome,No wonder they produce whole new level of brillant pass out students with the teaching faculty and clarity of subject like this.Thank you so much Harvard and the biggest gift of our time " The internet".
This is way better than paid courses from Udemy. I don't know why I wasted so much money on rubbish courses when I could've just taken this course.
never pay for a course when you can find it for free
The best things in life are free lol
@@lemon_maho The thing is, for a long time there were no courses like this for free.
Just give him some water for God sake!
Great job dude. It is really what I need.
A very dense and totally meaningful course! Instead of wasting time on nonsense coding bootcamps (html, css, python and Django) here you see the total pure logic background and create totally generic pages, submit buttons that does something and things changes according to input... I loved and each 5 mins or so wanted to press on the like button (first time ever) :)))
Thank you CS50 for posting this super useful lecture! Brian has excellent delivery skills.
This is the best lecture I have taken on Django
Brian should have his own software development learning startup and expand the content not covered on cs50! He'll give a real treasure to this world and earn 100 of millions if not billions doing so!
Brian is the best online teacher for me. i connect with his way of teaching so much that i understand everything he teaches so easily. i don't think i've enough words to thank him for this. God bless Brian
Around 25 min, when you already have dedicated views for Brian and David then I think you should prioritize them in first and the generic greet view comes later only in defining URLs paths. This is not an error but makes different logical outputs.
I am really thankful for your teaching.
Could you explain what you mean by different logical outputs? Transforming RUclips into stackoverflow I know :D
Thank you for this!!! Brian and David are amazing teachers!!
Omfg such good teacher, never stops, always knows what to say, tempo is just perfect, everything is so clear and you can easly follow along, congrats
wow! what an energy and a teacher. Thanks for this great teaching.
I was procrastinating while learning Django alot nothing new always happens to me , I was learning by Dj docs tuned this course on I have been studying for like 4-5 hrs now Brian got me hooked mann literally I wish i had a ai bot like brian that explained me everything i needed to know in my life
:0 brian ai...
Check his ai course 😂
It is such a hard work to squeeze so much information into a short video like this
Wow!
The pedagogy in this course is brilliant.
Congrats and thank you!
We need more teachers like him !
This video is awesome. Clears so many concepts about Django without being overwhelming.
Great delivery of content by one of the best Software Engineers. Looking forward to the next lecture.
1:18:38 where the madness is started 😵💫
literally from here the challenging part starts
31:28 render(request ,html page,context)
37:01 newyear app
43:36 python logic
48:00 static file
01:13:13 the info is posted to the same page we are in
01:34:00 no such table . error
This is the Best django course on the net. I advise anyone searching a good djanho course to focus on this.
Really great lecture. Feel like this video covers so much ground without ever getting too overwhelming.
Sir brine
You're ture is nice my parents worked as teachers in high school. Your lecturs very marvelous.
Thank-you
From
Kaladhar murakond
Thank you so much for making this wonderful lecture free! I learnt a lot from this course
my university is offering the course in pkr 20000 and he is for free and no words for his teaching thanks a lot sir
I suppose the collision error, 1:10:08, was somewhat intentional to explain the next steps in those cases.
But in this part 54:07 you can look at settings.py tasks is added at the end (after newyear) and at 54:13 urls.py tasks/ is NOT added at the end but before newyear/, hence the error.
* I put tasks in both cases (settings.py and urls.py) after newyear and there was no error.
good observation
When student is ready teacher will emerge, no need spend lot of money when we have this kind of courses
Open class and no hidden points keeping within paid class.
Thank you.
This course seems like perfect!
best web programming course all over the world
Great Lecture and explain simply about Django for beginners.
Wow after so long struggling with Django I learned more in this video than when I was trying learn it with AI
1:31 was the purest use of incognito I've ever seen.
1:31:30 *
Harvard baby!!! Thanks for the wonderful lessons via the tube of yOu!!
Another great lecture. Thanks for making these available.
at 1:36:17 when Brian changes the add function to, instead of updating the (deleted) global variable, update the task list in the session - why are we using this syntax += [task] ?
I know that the += is shorthand for append, but why is 'task' , that is obtained from the cleaned_data of the form and is a string, not simply appended to request.session["tasks"]] which is a list via the .append() method?
If I use request.session["tasks"].append(task) it doesn't work.
I'm trying to understand why.....
request.session["tasks"] = a list
task = a string
I should be able to use the append method on the list to append the string. I'm clearly missing something here.
Anyone that can explain this?
Made a stackoverflow question for this because it was bugging me and in the video Brian just 'acts like this is normal syntax' :)
stackoverflow.com/questions/63449525/append-to-request-sessionslist-in-django/63477092#63477092
Hi, Because i python u cant add one item in list with +=. you must add it to list with append function.
hey, when you use .append() the session by default won't be saved. Documentation here: docs.djangoproject.com/en/2.2/topics/http/sessions/#when-sessions-are-saved
I'm not sure, but it seems the syntax Brian used gets around that and forces Django to save the session without having to explicitly say: request.session.modified = True.
@@honoriuszbalzak thank you, that was helpful.
@@honoriuszbalzak Thanks
At 1:36:36 why does he use the += operator instead of using .append()? couldn't he just use .append() again? Was there a reason for this?
hey, when you use .append() the session by default won't be saved. Documentation here: docs.djangoproject.com/en/2.2/topics/http/sessions/#when-sessions-are-saved
I'm not sure, but it seems the syntax Brian used gets around that and forces Django to save the session without having to explicitly say: request.session.modified = True.
I take it as: CurrentTask + NewTasks = NewTasks(updated)
append(): This does not work request.session["tasks"].append(task)
but this work
list_tmp = request.session["tasks"]
list_tmp.append(task)
request.session["tasks"] = list_tmp
: )
@@freelanceprogrammer9537 Thank you!
This is...so much information.
00:11:10 - Routes
00:28:46 - Templates
Thank you, bro. I was struggling with getting into Django for like two weeks. You made it easy!
46:07 The smoothest bug fix I have ever seen
i got it very well and i really appreciated and how you guy make it clearly that anybody can understand
This is so powerful. There is nothing else you need to conquer the world (other than some cash runway to keep your experiment alive)
brain is brilliant , and I have really enjoyed the lecture, thanks buddy, your are doing great job
1:36:25 why it doesn't work if we utilize append like this??? request.session["tasks"].append(task), it only works if we write request.session["tasks"] += [task]
1:25:28 what determines if a form is valid or invalid? valid according to what criteria? and what is "cleaned_data"? Was that ever explained?
Thanks for the Tutorial. You have clarified some issues with limited time available.
I wish Brian has his own RUclips Channel! He is the best CS professor I have learnt from.
Indeed he has a channel ruclips.net/channel/UCDzVUXiTr3hClI-zzCWbYzg
1:10:14 - mine actually worked and didn't go to 'No' as yours did. Did I just get lucky? Does Django truly randomly decide which .html file to open?
I had the same result and did some experimenting. It is certainly not random.
Django seems to look in in the 'last url in the project's urlpatterns list' first. (lecture3/urls.py)
In your lecture3 project 'urls.py', if you change the list as follows:
urlpatterns = [
path('admin/', admin.site.urls),
path('tasks/', include("tasks.urls")),
path('newyear/', include("newyear.urls")),
path('hello/', include("hello.urls")),
]
so that 'hello' is last (recall that the hello APP also has a path with a name of 'index').
If you would now link to url 'index' - django will always go the index url of the hello APP.
As you can see at 54:10 , Brian (probably on purpose to drive his point home later) puts the path for tasks BEFORE the newyear path in the urlpatterns list.
You and I added it to the end of the list and as such we did not produce this problem.
Having said all of that - it is good practice to name your apps so you can explicitly link to them.
@@zerodivided3676 Thank you, you were smart!
@@zerodivided3676 People are so smart at debugging, I hope that I'll be like you someday
cs50 is doing a great job for common people
You fill the gaps I had, such an amazing teacher, now I can read the rest with more confidence, thanks
There's a minimal logical error at the end since the "request.session[tasks]" only creates if the user goes first to the url "/tasks/", however if the user goes first to the url "/tasks/add" , the "request.session[tasks] is not created, so if the user tries to add a new task, it won't work.
just a little observation, it was a great lecture
its working though
Yes, but add in def add(request):
if "tasks" not in request.session:
request.session["tasks"]=[]
and this work fine! (if the user goes first to the url "/tasks/add")
I finally understood what the csrf token does! That aside, great lecture, thank you!
This is amazing content and very high quality... Love it alot ...Just came for the Django portion.
Thank you as always for the clear succinct lecture!
How can he just do a lecture for nearly 2 hours straight with so much energy. I would fall asleep in the first 5 mins if I was him. Anyway I learnt alot from this lecture
@ 51:00 you need to write {% load static %} above the css link to get it working on the actual version of django.
I usually skip long videos but this thisss was totally worth it. a 1000 blessings to you. also whoever was in charge of the camera movements blew my mind.
its automatic tracking
Great Lecture Brian Yu!
Dang! This video was made back in January, but they uploaded this two months later.
Thank you from the bottom of my heart Brain. May God bless you 🙏
Thanks to Dr Malan, Jordan Hayashi and Brian Yu i have my own programming channel. Ive started in CS50 earlier than that like 9 years ago
estou aplaudindo esse curso com os pés porque com as mãos estou programando
Amazing Presentation. A real pleasure to follow this young and skilled instructor .
- Thanks
this went from 0 to 100 and Brian says we just scratched the surface of Django
You're an excellent teacher, thank you!
36:09 - Me watching this tutorial on Christmas day!
Lol, I missed this opportunity
36:58 this one i can use😂😂
19:45 in this page it's show to me attribute error at /app/ .
thank you for the great content. I learned a lot it from you
Great lesson! Thanks for sharing with us :)
great tutorial for web dev starters
This guy is just too good
This. Looks. Powerful. Man I need to master it.
1:21:50 but how would you add css to something that was written using Python, even worse how would you add bootstrap to that? I've searched a little and i have only found ugly code, i think that REALLY needed an explanation since raw html is unacceptable
Man this lecture was a freaking trip
You probably should code along him
Really thanks, Harvard.
Thank you CS50 for this lecture. Great job Brian and David.
1:09:00 when i open the tasks page it gives error set object not reversible and if i change {% url 'add' %}
to [% url 'add' %] the index page opens but clicking the link gives a 404 error. I searched the internet and documentation and don't know what im doing wrong. Can someone help me?
same. did you find a solution
Amazing teacher
This was a cool lesson. Good stuff.
What is that mean in 1:13:59 "It doesn't include parameter inside the url the way a get request does, as we saw at Google , for example."
With get request, if you typed your password in to a submit box, it would show you password in the url and that wouldn’t be good. But like a google search you can see what you typed in the url. Post allows to hide data like passwords
Very nice course, would it be possible to talk about Django Rest Framework please?
Best of the best work
Hello, at 1:08:56 the href="{% url 'add' %}", and href="{% url 'tasks:add' %}", is not working. Has this been changed? Also, href="/tasks/add" works fine.
Was able to fix for 'add', turns out my url patterns for newyear was in {} instead of [].
whoops, turns out I had action="{% url 'tasks:add' %}" method="post" in the bottom form tag lol
I can’t believe this is all for free
Thank you Brian, you are such a great teacher!
Excellent course and good teacher, keep like that. It "1hr" lecture but its really 3hs if you want to follow his peace..Thanks for the Free course.
thank for valuble series
Thanks! Helped a lot.
Thank you for your efforts very helpful video
Oh they actually review your code in this web course :0 now i am anxious 😰😰😰
If the user at 1st visits the add function without visiting the index function it throws attribute error because tasks key in session dictionary is created in the index function !!
37:07 - Creating a new app (Is it New Year's)
Excelente estructuración del contenido!