CS50x 2024 - Lecture 9 - Flask

  Рет қаралды 202,939

CS50

CS50

Күн бұрын

Пікірлер: 141
@Damonbodine
@Damonbodine 10 ай бұрын
Seeing David use the duck made me realize I’m not alone. Such a real moment Love this course so much.
@ProgrammerPenguin
@ProgrammerPenguin 6 ай бұрын
when does he do that?
@lintz_lin
@lintz_lin 6 ай бұрын
@@ProgrammerPenguin 1:22:42
@ProgrammerPenguin
@ProgrammerPenguin 6 ай бұрын
@@lintz_lin thanks for replying so quickly and also that's funny as hell.
@tensevo
@tensevo 3 ай бұрын
I know right, students need to see you are both godlike and with human flaw, for them to be inspired.
@ClearSteps-e6l
@ClearSteps-e6l Ай бұрын
@@tensevo exactly
@dwkeirstead
@dwkeirstead 10 ай бұрын
The moment with the DDB was hands down my favorite moment so far in these lectures. So relatable and David’s reaction was honestly adorable 😅 so he is human too…
@stepanrusinko2456
@stepanrusinko2456 Жыл бұрын
This is the big reckoning, so much is connecting together. My head hurts but I am not giving up this far.
@lpdemodimi
@lpdemodimi 11 ай бұрын
This is the way.
@FlowersByIrene
@FlowersByIrene 10 ай бұрын
I just looked at Problem Set 9 Finance and it truly does all come together. Quite overwhelming
@boundlesstraveller
@boundlesstraveller 9 ай бұрын
Keep it up and enjoy every minute of it...❤
@arnab_x24
@arnab_x24 8 ай бұрын
This man is a legend and the best teacher that I found till now... Lots of love and respect to prof. David J. Malan and the entire team of CS50
@alainrouleau
@alainrouleau 7 ай бұрын
6:36 This is actually a very good definition for a so-called "framework" that I never really thought about before. It's not just third-party code. But it's third-party conventions as well. Which means you may have to learn a whole new syntax, etc.
@johnpasir3207
@johnpasir3207 10 ай бұрын
great class... definitely not for beginning beginners but more for advanced beginners
@meera.srivastava
@meera.srivastava 5 ай бұрын
i was an absolute beginner when i started cs50 and i think that if you care about the subject and are willing to put in the time and effort, then you can do it! it’s bound to be hard, but just keep going yk?
@velezmusic4350
@velezmusic4350 9 ай бұрын
It was nice to see the maestro get flustered but gracefully demo his googling / prompting. That hunch and deep breath was not giving staged 😂
@lpdemodimi
@lpdemodimi 11 ай бұрын
ok this really fried my brain. Thank you for the efforts, will need to let that sink in.
@CarlosReyes-e3o
@CarlosReyes-e3o 3 ай бұрын
At. 1:22:47 LOL. He is Human!!! I have never loved him more than at that moment! Thank you for what you do, David!
@UnboxRacing
@UnboxRacing 7 ай бұрын
"Let me go ahead and PROPOSE that...." Bingo! Classic David. I wish we had Profs like DM when I was at school.
@MarkBetterDev
@MarkBetterDev Жыл бұрын
after every lecture i watch, i tend to think to myself how i would've coped if i was a complete beginner. even with a year of coding, this course is hard
@prcvl
@prcvl 11 ай бұрын
this course is really easy
@berkeumutsahinturk921
@berkeumutsahinturk921 11 ай бұрын
just no@@prcvl
@harshpalsinhzala1092
@harshpalsinhzala1092 11 ай бұрын
I was a complete beginner when I took this course 2 years ago. I don't think it's that hard. In fact because of it, I fell in love with Computer science and now I'm half way through my degree.😊
@elokthewizard
@elokthewizard 9 ай бұрын
@@prcvlthis was a productive and positive comment. this is the kind of comment that makes people value your input and become your friend.
@elokthewizard
@elokthewizard 9 ай бұрын
i came from the odin project - the insight this course provides is the difference between blind flailing and planned execution
@lionking2592
@lionking2592 5 ай бұрын
🎉 completed. This is awesome intro for flask begginers. THANK YOU 🙏🙏
@teaganp5011
@teaganp5011 7 ай бұрын
I’m really thankful for this class. It really feels like I am part of the class and that duck debugger moment get so relatable
@fyardlest1
@fyardlest1 4 ай бұрын
The real Flask course!
@MazineZ
@MazineZ 11 ай бұрын
Every lesson fulfills my brain with so much information and this is no exception.
@AnythingGoesCodes
@AnythingGoesCodes 6 ай бұрын
Duck >> Stack Overflow > glance at the audience for help
@josephlevin
@josephlevin 2 ай бұрын
~1:23:00 That was very rich. I admire David's humor and candor in that moment, and appreciate how I'd have done exactly as he did- Googling then Ducking for an answer!
@Piranha_Dark
@Piranha_Dark Жыл бұрын
Thanks once again for an amazing and helpful content. Cheers to 2024 🎉
@faizanahmed9304
@faizanahmed9304 Жыл бұрын
Thank you team @CS50
@Aman-fz1ew
@Aman-fz1ew 11 ай бұрын
Awesone Video . Simultaneously coding helps to understand the concept
@BrokenRecord-i7q
@BrokenRecord-i7q 10 ай бұрын
Do you use fuel monitor.
@TheeInfoBaron
@TheeInfoBaron 13 күн бұрын
David using the duck and google for the getlist command reminded me that he is indeed human. Novel moment, absolutely love the guy!❤
@mikael5914
@mikael5914 9 ай бұрын
Excellent course quality aside. Is anyone else obsessed with the soundtrack (intro)?
@paolobalestriere1201
@paolobalestriere1201 5 ай бұрын
present
@TháiĐạt2012
@TháiĐạt2012 4 ай бұрын
David is so good that even when he messes up, people still like it
@grindinguy
@grindinguy 11 ай бұрын
hardest part of the all lecture imo
@Alexander-iq5yq
@Alexander-iq5yq 11 ай бұрын
Something weird happens at 50:27
@coreydubia2881
@coreydubia2881 10 ай бұрын
AI generated David!🤣
@jeannoelhonisch7037
@jeannoelhonisch7037 6 ай бұрын
I knew he would be an alien or sum cause my teachers didn't teach as he does.
@mr_DIY
@mr_DIY Жыл бұрын
That’s the lecture here. A lot but interesting ❤
@ronaldogandra
@ronaldogandra 3 ай бұрын
"RALLRIGHT, any other questions this far on this...?" some of David's phrases just stick in your head lol thanks for this course!!
@CodingByAmp
@CodingByAmp 10 ай бұрын
love cs50 flask
@wrt3778
@wrt3778 3 ай бұрын
So much energy! Thank you.
@ChristopherBruns-o7o
@ChristopherBruns-o7o 5 ай бұрын
1:03:55 can't you use base64 and assign an id to get Sports in hex and css the id tag?
@GenZ_01_
@GenZ_01_ 4 ай бұрын
Another high quality lecture🙏🏽
@jazzyniko
@jazzyniko 9 ай бұрын
app = Flask(__name__) Is this calling a function or creating an object from the class Flask? Can someone explain this, please? (on minute 12:22 more or less)
@jazzyniko
@jazzyniko 9 ай бұрын
Ok I found this so now I understand that better: In Python, classes can be callable, which means they can behave like functions when called. When you use Flask() in Flask, you're actually calling the Flask class, which acts as a constructor function to create a new instance of the Flask application. So, to clarify, Flask() is both a class and a function. It's a class because it defines the blueprint for Flask applications, and it's a function because you use it to instantiate objects of that class.
@alainrouleau
@alainrouleau 7 ай бұрын
Using the CS50 duck was nice... But I'm surprised I haven't seen more use of the built-in help function? I don't think it's even been mentioned once? Could be wrong though. Very easy to use, for example, in the terminal just use >>> help(print) at the prompt. Will tell you everything you need to know about the print function and all its parameters. Same thing for any other object such as a class, function/method, module, list, dict, str, int, etc. Plus, there's code completion in VS Code or simple dot notation with documentation pop-ups. Has all of that been disabled? Knowing how to access and read documentation is a skill every developer or programmer needs to know.
@ptd3v
@ptd3v 9 ай бұрын
I got a little lost in this episode, I think it was the Jinja stuff. The duck saving the day was amazing.
@bastionbet3809
@bastionbet3809 8 ай бұрын
Почему так много людей пишет, что курс сложный?!) Я программирую пару месяцев и этот курс выглядит максимально понятным и доступным для всех!
@shawn14isme
@shawn14isme 3 ай бұрын
Here i was thinking that i was doing crazy stuff with bootstrap last week.
@chrisjoyce4047
@chrisjoyce4047 7 ай бұрын
There are two problems with the code presented in the lecture in the froshims section. Firstly, David's code uses request.form.getall which does not work in the current CS50 ide. You need to use request.form.getlist instead. Secondly, "Ultimate Frisbee" gives an error when a loop is used to check the sports with {{sport}}. To make it work you need to use "{{sport}}" instead.
@rida_brahim
@rida_brahim 10 ай бұрын
i faced some trouble with the cart app, the session["cart"] is that holds the list containing the id's of books added to the cart isn't working, after debugging and printing the values i always find myself passing an empty list to the cart.html, i tried to figure what's going on and found out that the Sqlite command to books = db.execute("SELECT * FROM books WHERE id IN (?)", session["cart"]) didn't want to work, it seems that the syntax somehow wrong and even chatgpt told me that maybe sqlite is expecting multiple "?" to process the list and not only one "?" to use the list, but for professor David it's working fine, note: i didn't implement the logic manually i literally downloaded the file src9, any idea guys ?
@rida_brahim
@rida_brahim 10 ай бұрын
i found the solution, i will post it here if someone got stuck with this problem, after debugging and adding another list of my own, like this : if book_id: session["cart"].append(book_id) list_test.append(book_id) , i noticed that session["cart"] didn't add all the id's appended to it but list_test had all the values in it, so it was a problem of consistency from session["cart"], the solution after explaining the issue to duck debugger was to add this line : session.modified = True | after appending to the session["cart"] , it seems that this line just tells flask that the session got some new changes. i'm using flask on my local machine and running the server on my windows not codespace so probably that's the issue.
@jeerasakchanprasertkul3856
@jeerasakchanprasertkul3856 10 ай бұрын
I faced the same problem. Another way to solve it is to change this line of code from: session["cart"].append(book_id) to: cart = session["cart"] cart.append(book_id) session["cart"] = cart It's not the best solution, but it works
@tonyvenice5252
@tonyvenice5252 2 ай бұрын
Strangely, I had the same error and chat gpt gave me the same answer as "Flask only tracks changes if you reassign the modified list back to session["cart"]." but my error was writing : if cart not in session: instead of if "cart" not in session: Now it works like in the course
@makira4685
@makira4685 27 күн бұрын
"what a good duck!" I say that EVERY time now
@FreakCho
@FreakCho 16 күн бұрын
looks like i need to watch the video again so that i can wrap my head around
@RomarioKurti28
@RomarioKurti28 10 ай бұрын
Profesor is hilarious 😂
@UnboxRacing
@UnboxRacing 7 ай бұрын
If you are following this at home your won't have access to the same environment as David. Advisable to create virtual environment in 'hello' and run flask that way. Django would have been nice but DM's teaching is world class.
@freelance-writer
@freelance-writer 3 ай бұрын
1:22:40 Love it. 🦆
@alex.triflesclear5827
@alex.triflesclear5827 11 ай бұрын
Finally got here, thanks god!
@ShivanshSanghvi
@ShivanshSanghvi Жыл бұрын
4th comment? also thanks cs50, amazing course from which I have learned a lot
@caiofernando
@caiofernando 7 ай бұрын
I have a question about the last bit of this lecture. Since he got rid of the template search.html and just returned the jsonified list of shows, at what point does the json file get iterated over and converted into a list with the titles of the movies? I'm assuming version 3 of shows has an extra piece of code at index.html that does that, right?
@usuariodefectuoso4046
@usuariodefectuoso4046 6 ай бұрын
Yeah, i had to download the src material to see that on index.html these lines are added inside of the for loop (it sanitizes the title to prevent HTML injection) : let title = shows[id].title.replace('
@caiofernando
@caiofernando 6 ай бұрын
@@usuariodefectuoso4046 Yeah, I was able to find the answer in the notes as well!
@mallickpriyanshu
@mallickpriyanshu 9 ай бұрын
I love the moment of David with DDB 😂 He was honest and adorable and It's what all devs do when they get stuck 😂
@hemelhasan348
@hemelhasan348 8 ай бұрын
2:05:35 not working for me. Any solution!
@TheImaginativeSachin
@TheImaginativeSachin 2 ай бұрын
1:10:58 As soon as you put a web application on the internet, bad things will happen to it! 😂 So true!
@SMD-kk8ud
@SMD-kk8ud 5 ай бұрын
Just....Awesome!!
@noaydev
@noaydev 10 ай бұрын
I'm going to make it 🔥🔥🔥🔥🔥
@arungjose1849
@arungjose1849 3 ай бұрын
Can anyone please tell me why cs50 thought of teaching Flask rather than Django? Do more people use Django nowadays? Are there any frameworks better than flask and django, and was this just to teach the basics? Anyways, I really enjoyed the class
@LeelaSankharM
@LeelaSankharM 3 ай бұрын
flask is a microframework and is simple than django. i think cs50 opted flask so that it doesnt overwhelm the students but teaches the fundamentals, get the job done. tbvh for me this was very intense, imagine how it would be for django. and also coming to frameworks which are better is a subjective topic ig!
@not_amanullah
@not_amanullah 9 ай бұрын
This is helpful ❤
@RomarioKurti28
@RomarioKurti28 10 ай бұрын
My last week 🎉🎉🎉🎉😂
@Herzhoz
@Herzhoz 9 ай бұрын
This was the last one? great content, btw
@Nikita_Code
@Nikita_Code 9 ай бұрын
in my virtual workplace " flask run" give me an error in a web page 🙄
@UnboxRacing
@UnboxRacing 7 ай бұрын
Yup me too
@Svish_
@Svish_ 7 ай бұрын
Really wish you would've introduced the label tag, instead of using the placeholder-attribute, which is kind of terrible for multiple UX and accessibility reasons 😟
@chrisjoyce4047
@chrisjoyce4047 7 ай бұрын
Continuing the lecture I see he fixed the request.form.getlist problem, but the second problem remains.
@swampguy277
@swampguy277 6 ай бұрын
the DDB moment was so damn funny hahah
@aopen130
@aopen130 9 ай бұрын
01:22:00 wow. I can estimate the amount of sweat drip down his back while his code is not working in front of hundred of students.😅
@RomarioKurti28
@RomarioKurti28 10 ай бұрын
How come in the shows part, the html placeholder is {{show}} while in the app.py file the variable is show(singular) and it still works?
@tjejenathina3829
@tjejenathina3829 10 ай бұрын
Unless I'm mistaken, it's because Flask uses Jinja as a template engine. Jinjas syntax uses double brackets while python only singular. But double check the jinja documentation so im not lying to you lol
@danon3170
@danon3170 8 ай бұрын
Привет из Ленинградского государственного университета 🤙
@rafiullah-zz1lf
@rafiullah-zz1lf 7 ай бұрын
🎉🎉🎉🎉 feeling happy finally got finance done and got 21 /21. Thanks @david J.Malan
@01juniorpen
@01juniorpen 7 ай бұрын
01:40:00
@01juniorpen
@01juniorpen 7 ай бұрын
done
@s.baskaravishnu22
@s.baskaravishnu22 Ай бұрын
Many thanks
@GucciJohanne
@GucciJohanne 9 ай бұрын
had to watch this at 0.9 speed LOL 😅
@xiuzhenyang8047
@xiuzhenyang8047 7 ай бұрын
Anyone know how to open a terminal after I accidentally close all the terminal?
@boncoderz1430
@boncoderz1430 6 ай бұрын
Click Open in integrated terminal after u right click any file in ur vsc.
@xiuzhenyang8047
@xiuzhenyang8047 5 ай бұрын
@@boncoderz1430 Thank you!!
@harshpareta-o6o
@harshpareta-o6o 2 ай бұрын
Cheers !
@ansh4131
@ansh4131 3 ай бұрын
42:00
@luigi-b5m
@luigi-b5m 8 ай бұрын
Thank you.
@thetasworld
@thetasworld 7 ай бұрын
And I thought week 8 was tough...good lord.
@matei8327
@matei8327 6 ай бұрын
Its hard, Its useful to make projects and use every new thing that you learn in this week. Practice everythig ;)
@viniciusalencardev
@viniciusalencardev Жыл бұрын
very great
@八玲珑
@八玲珑 11 ай бұрын
这个教程真的很牛逼
@labaz_dictateurgaming
@labaz_dictateurgaming Ай бұрын
Game idea... let me go ahead and have a shot every time David says "Let me go ahead and..."
@not_amanullah
@not_amanullah 11 ай бұрын
Understood++
@e.n85784
@e.n85784 5 ай бұрын
I wonder if Yale will add the term "boilerplate" to their Bingo card
@BarronMartinez-tz1up
@BarronMartinez-tz1up 8 ай бұрын
Coming here to prep for my interview next week for django web dev. I know im gonna learn alot and be entertained.
@Hillgrov
@Hillgrov 6 ай бұрын
hopefully you know this by heart if you're going to apply for a webdev job :S
@Alec0
@Alec0 6 ай бұрын
How did it go?
@kidzeeplier2468
@kidzeeplier2468 5 ай бұрын
how did it go?
@Hillgrov
@Hillgrov 5 ай бұрын
@@kidzeeplier2468 guess OP lost all hope and moved into the wilderness.
@kidzeeplier2468
@kidzeeplier2468 5 ай бұрын
@@Hillgrov and..he was never seen again.
@chrikke
@chrikke 2 ай бұрын
If only there was a language that could do this kind of server side rendering lol
@bpopphixo9627
@bpopphixo9627 3 ай бұрын
Help me i don't know what i need to remember
@FreakCho
@FreakCho 16 күн бұрын
I think you should implement some starting things till he introduce src9 and then just sit and watch then rewatch the lecture again and focus what he is doing why is he doing that thing. maybe that would help
@tinvan8146
@tinvan8146 4 ай бұрын
1:01:16 his voice xD
@Dpk_YT
@Dpk_YT Жыл бұрын
❤❤
@danilbanan406
@danilbanan406 Жыл бұрын
Why they using flask ? Why not FastApi
@hiramarturooliveromuoz3728
@hiramarturooliveromuoz3728 10 ай бұрын
Flask is better
@LoadNewYear
@LoadNewYear 9 ай бұрын
Flask is simpler for students to understand as many of us are beginners who are taking CS50 as their first course.
@bekay7663
@bekay7663 8 ай бұрын
It's always strange when people act like they know more then the teacher. The entire course curated the way it is for a reason.
@quang.luu.179
@quang.luu.179 6 ай бұрын
👍👍👍
@chal7z
@chal7z 4 ай бұрын
@Rapha_Carpio
@Rapha_Carpio 4 ай бұрын
40:05 what happen with these people, they dont ask question having the opportunity of be with this guy face 2 face........
@MrSomethingdark
@MrSomethingdark Ай бұрын
1:12:22 pipe meme
@SkepticLens
@SkepticLens Жыл бұрын
2nd comment?
@ferabreu1980
@ferabreu1980 9 ай бұрын
What a good duck. 😄 But... CS50's staff is smarter than this. I'm sure it was all made up just to show the AI off. 😂
@JeremyMitts
@JeremyMitts 6 ай бұрын
If that's the case, David deserves an Oscar. It was the most believable acting I've ever witnessed... (stop it. humans make mistakes.)
@7amseel
@7amseel 5 ай бұрын
I also suspect that a little bit. Because they are so prepared for everything, like every tiny detail to be mentioned is included in the slides and the code. Even the mistakes are intentionally designed so that David can teach the process of improving code instead of impossibly trying to get it perfect the first time. So, I have no reason to believe that they hadn't actually worked it all before and it accidentally was mistyped in his printouts. But still can't rule out the other possibility cuz we are all humans. (Somebody ask CS50 staff. I am curious!)
@SathvikP-v3v
@SathvikP-v3v 3 ай бұрын
I also think the same. Even though there exist so many platforms where you could debug errors, the team wants us to use the duck instead of other platforms which would limit taking help everytime. That was pre-planned for sure !
CS50x 2024 - Cybersecurity
1:31:17
CS50
Рет қаралды 148 М.
CS50x 2024 - Lecture 8 - HTML, CSS, JavaScript
2:29:29
CS50
Рет қаралды 255 М.
Ful Video ☝🏻☝🏻☝🏻
1:01
Arkeolog
Рет қаралды 14 МЛН
Caleb Pressley Shows TSA How It’s Done
0:28
Barstool Sports
Рет қаралды 60 МЛН
Why I Use C | Prime Reacts
13:00
ThePrimeTime
Рет қаралды 191 М.
FastAPI, Flask or Django - Which Should You Use?
9:49
Tech With Tim
Рет қаралды 119 М.
CS50x 2025 - Lecture 9 - Flask
3:03:45
CS50
Рет қаралды 13 М.
Web Developers Are Disconnected
21:36
ThePrimeTime
Рет қаралды 256 М.
you will never ask about pointers again after watching this video
8:03
CS50x 2024 - Lecture 7 - SQL
2:14:05
CS50
Рет қаралды 545 М.
Ful Video ☝🏻☝🏻☝🏻
1:01
Arkeolog
Рет қаралды 14 МЛН