title
Python Django Web Framework - Full Course for Beginners

description
Learn the Python Django framework with this free full course. Django is an extremely popular and fully featured server-side web framework, written in Python. Django allows you to quickly create web apps. 💻Code: https://github.com/codingforentrepreneurs/Try-Django ⭐️Course Contents ⭐️ ⌨️ (0:00:00) 1 - Welcome ⌨️ (0:01:14) 2 - Installing to Get Started ⌨️ (0:05:02) 3 - Setup your Virtual Environment for Django ⌨️ (0:14:39) 4 - Create a Blank Django Project ⌨️ (0:18:54) 5 - Setup Your Code Text Editor ⌨️ (0:22:27) 6 - Settings ⌨️ (0:29:58) 7 - Built-In Components ⌨️ (0:33:57) 8 - Your First App Component ⌨️ (0:42:34) 9 - Create Product Objects in the Python Shell ⌨️ (0:46:18) 10 - New Model Fields ⌨️ (0:52:52) 11 - Change a Model ⌨️ (0:59:27) 12 - Default Homepage to Custom Homepage ⌨️ (1:04:48) 13 - URL Routing and Requests ⌨️ (1:10:23) 14 - Django Templates ⌨️ (1:16:50) 15 - Django Templating Engine Basics ⌨️ (1:24:00) 16 - Include Template Tag ⌨️ (1:26:49) 17 - Rendering Context in a Template ⌨️ (1:33:21) 18 - For Loop in a Template ⌨️ (1:37:01) 19 - Using Conditions in a Template ⌨️ (1:42:17) 20 - Template Tags and Filters ⌨️ (1:48:59) 21 - Render Data from the Database with a Model ⌨️ (1:59:55) 22 - How Django Templates Load with Apps ⌨️ (2:06:50) 23 - Django Model Forms ⌨️ (2:14:16) 24 - Raw HTML Form ⌨️ (2:25:33) 25 - Pure Django Form ⌨️ (2:35:30) 26 - Form Widgets ⌨️ (2:41:29) 27 - Form Validation Methods ⌨️ (2:48:59) 28 - Initial Values for Forms ⌨️ (2:51:42) 29 - Dynamic URL Routing ⌨️ (2:54:26) 30 - Handle DoesNotExist ⌨️ (2:56:24) 31 - Delete and Confirm ⌨️ (2:58:24) 32 - View of a List of Database Objects ⌨️ (3:00:00) 33 - Dynamic Linking of URLs ⌨️ (3:01:17) 34 - Django URLs Reverse ⌨️ (3:03:10) 35 - In App URLs and Namespacing ⌨️ (3:07:35) 36 - Class Based Views - ListView ⌨️ (3:10:45) 37 - Class Based Views - DetailView ⌨️ (3:15:38) 38 - Class Based Views - CreateView and UpdateView ⌨️ (3:21:23) 39 - Class Based Views - DeleteView ⌨️ (3:24:02) 40 - Function Based View to Class Based View ⌨️ (3:27:15) 41 - Raw Detail Class Based View ⌨️ (3:30:31) 42 - Raw List Class Based View ⌨️ (3:33:32) 43 - Raw Create Class Based View ⌨️ (3:26:03) 44 - Form Validation on a Post Method ⌨️ (3:37:58) 45 - Raw Update Class Based View ⌨️ (3:41:13) 46 - Raw Delete Class Based View ⌨️ (3:42:17) 47 - Custom Mixin for Class Based Views Course from Coding for Entrepreneurs. Check out their YouTube channel: https://www.youtube.com/channel/UCWEHue8kksIaktO8KTTN_zg Also, check out the Coding For Entrepreneurs website for more great content: https://www.codingforentrepreneurs.com -- Learn to code for free and get a developer job: https://www.freecodecamp.org Read hundreds of articles on programming: https://medium.freecodecamp.org

detail
{'title': 'Python Django Web Framework - Full Course for Beginners', 'heatmap': [{'end': 3927.753, 'start': 3790.547, 'weight': 0.984}, {'end': 4470.378, 'start': 4328.292, 'weight': 1}, {'end': 8938.396, 'start': 8800.3, 'weight': 0.933}, {'end': 9208.262, 'start': 9072.843, 'weight': 0.74}, {'end': 13272.189, 'start': 12995.697, 'weight': 0.865}], 'summary': 'This python django full course for beginners covers mastering django basics, setting up python, django, and virtual environment, django configuration, components, custom apps, model administration, migrations, django development essentials, improving webpage with django templating, django templates, model forms, form security, form creation and handling, form customization, validation, model form data, dynamic url handling, namespace in django, views, forms, class-based views, form handling, and conversion of function-based views to class-based views, providing a comprehensive learning experience.', 'chapters': [{'end': 128.781, 'segs': [{'end': 128.781, 'src': 'embed', 'start': 94.568, 'weight': 0, 'content': [{'end': 99.995, 'text': "And perhaps you've already done that with other web applications, or perhaps this is the first time you're programming.", 'start': 94.568, 'duration': 5.427}, {'end': 106.602, 'text': 'Either way, the most frustrating part is at the beginning, not so much because of the programming language,', 'start': 100.555, 'duration': 6.047}, {'end': 109.626, 'text': 'but often because of how to actually set up your system.', 'start': 106.602, 'duration': 3.024}, {'end': 117.893, 'text': "And since it's so frustrating, over years, we've refined the way to set up your system depending on what you're on.", 'start': 110.567, 'duration': 7.326}, {'end': 119.414, 'text': "And that's part of the frustration.", 'start': 118.013, 'duration': 1.401}, {'end': 124.658, 'text': "It's like, you're going to see me working a lot in a Mac, so Mac OS environment.", 'start': 119.454, 'duration': 5.204}, {'end': 128.781, 'text': "And if you're on Windows, you're like hey, why isn't it the same??", 'start': 124.838, 'duration': 3.943}], 'summary': "Setting up system for programming can be frustrating, but it's been refined over years depending on the platform.", 'duration': 34.213, 'max_score': 94.568, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U494568.jpg'}], 'start': 0.831, 'title': 'Mastering django basics', 'summary': 'Aims to guide learners in mastering django, starting from the absolute basics, and progressively introducing new concepts, enabling them to build real web applications with a database attached, while addressing the frustration of setting up the system.', 'chapters': [{'end': 128.781, 'start': 0.831, 'title': 'Mastering django basics', 'summary': 'Aims to guide learners in mastering django by starting from the absolute basics and progressively introducing new concepts, enabling them to build real web applications with a database attached, while also addressing the frustration of setting up the system.', 'duration': 127.95, 'highlights': ['The chapter emphasizes starting from absolute basics and gradually introducing new concepts to help learners build real web applications using Django.', "The frustration of setting up the system is addressed, with a focus on refining the setup process based on the user's operating system, such as Mac OS or Windows.", 'The importance of learning from entire projects is recommended, providing additional resources for building real web applications with Django.']}], 'duration': 127.95, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U4831.jpg', 'highlights': ['The chapter emphasizes starting from absolute basics and gradually introducing new concepts to help learners build real web applications using Django.', "The frustration of setting up the system is addressed, with a focus on refining the setup process based on the user's operating system, such as Mac OS or Windows.", 'The importance of learning from entire projects is recommended, providing additional resources for building real web applications with Django.']}, {'end': 1362.071, 'segs': [{'end': 445.864, 'src': 'embed', 'start': 416.786, 'weight': 1, 'content': [{'end': 418.668, 'text': "if you don't see it, just do make their dev.", 'start': 416.786, 'duration': 1.882}, {'end': 421.89, 'text': 'Right So in my case, I already have it there.', 'start': 419.608, 'duration': 2.282}, {'end': 429.775, 'text': "So I get this error, I'm going to just CD into my dev folder, right? This is where I keep all of my development projects.", 'start': 421.95, 'duration': 7.825}, {'end': 436.038, 'text': "So in here, I'm going to go ahead and make a directory called try Django, we're going to CD into that directory.", 'start': 430.555, 'duration': 5.483}, {'end': 438.58, 'text': "And then we're going to create our virtual EMV.", 'start': 436.679, 'duration': 1.901}, {'end': 445.864, 'text': "Now before I create it, I'm just going to hit virtual EMV and make sure I don't see any errors, I see that there's all sorts of options I can do.", 'start': 439.22, 'duration': 6.644}], 'summary': "Creating a 'try django' directory in 'dev' and setting up a virtual environment.", 'duration': 29.078, 'max_score': 416.786, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U4416786.jpg'}, {'end': 577.616, 'src': 'embed', 'start': 553.37, 'weight': 4, 'content': [{'end': 559.796, 'text': 'So I can do source bin slash activate, and a Mac environment in a Windows environment, of course, it scripts us activate.', 'start': 553.37, 'duration': 6.426}, {'end': 562.498, 'text': 'And then you can also run deactivate.', 'start': 560.677, 'duration': 1.821}, {'end': 566.882, 'text': 'Okay, so deactivate just ends the virtual environment.', 'start': 562.518, 'duration': 4.364}, {'end': 574.225, 'text': "Cool So what is the purpose of having a virtual environment? If you don't already know, well, it's as simple as doing pip freeze.", 'start': 567.682, 'duration': 6.543}, {'end': 577.616, 'text': 'You see all this stuff, I see Django 1.10.', 'start': 575.065, 'duration': 2.551}], 'summary': "Using a virtual environment allows running mac scripts on windows, with the purpose being evident in the output of 'pip freeze'.", 'duration': 24.246, 'max_score': 553.37, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U4553370.jpg'}, {'end': 657.691, 'src': 'embed', 'start': 629.933, 'weight': 0, 'content': [{'end': 634.656, 'text': "If you don't have it working, watch this next part, rewind and then install the things you need to install,", 'start': 629.933, 'duration': 4.723}, {'end': 637.958, 'text': "because I'm going to go pretty fast but still explain what's going on.", 'start': 634.656, 'duration': 3.302}, {'end': 642.421, 'text': "Okay, so I'm going to close out all of my terminal windows and act like I'm starting from zero.", 'start': 638.518, 'duration': 3.903}, {'end': 645.863, 'text': 'Okay, so I jump into my terminal window.', 'start': 643.041, 'duration': 2.822}, {'end': 646.924, 'text': 'I go into.', 'start': 645.863, 'duration': 1.061}, {'end': 651.167, 'text': "I'm going to go ahead and make a new dev folder called dev two.", 'start': 646.924, 'duration': 4.243}, {'end': 653.649, 'text': "I'm gonna CD into dev two and list everything out.", 'start': 651.167, 'duration': 2.482}, {'end': 654.269, 'text': "nothing's in there.", 'start': 653.649, 'duration': 0.62}, {'end': 657.691, 'text': "So I'm gonna, I'm gonna show you three different ways and creating a virtual environment.", 'start': 654.749, 'duration': 2.942}], 'summary': 'Demonstration of creating a new dev folder and three ways of creating a virtual environment.', 'duration': 27.758, 'max_score': 629.933, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U4629933.jpg'}, {'end': 742.218, 'src': 'embed', 'start': 711.318, 'weight': 6, 'content': [{'end': 715.299, 'text': "So which Python three will not work if Python three doesn't work right?", 'start': 711.318, 'duration': 3.981}, {'end': 720.943, 'text': "So every once in a while, you install Python in your system and it's just installed somewhere else.", 'start': 716.239, 'duration': 4.704}, {'end': 722.885, 'text': "And this command itself doesn't work.", 'start': 721.344, 'duration': 1.541}, {'end': 732.793, 'text': 'But wherever that is actually installed on any system and you do something like this you actually paste in the path to that and hit enter.', 'start': 723.425, 'duration': 9.368}, {'end': 735.055, 'text': 'that should actually open up Python three for you.', 'start': 732.793, 'duration': 2.262}, {'end': 742.218, 'text': 'So then that means that the final way to actually start a virtual environment is virtual EMV, the EMV three,', 'start': 735.815, 'duration': 6.403}], 'summary': "To start a virtual environment, use 'virtualenv -p path/to/python3'.", 'duration': 30.9, 'max_score': 711.318, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U4711318.jpg'}, {'end': 810.479, 'src': 'embed', 'start': 780.153, 'weight': 8, 'content': [{'end': 783.075, 'text': "but that's a few different ways on how you can create a virtual environment.", 'start': 780.153, 'duration': 2.922}, {'end': 788.359, 'text': "Now, in my case, I'm actually going to go ahead and get rid of that dev2 folder.", 'start': 783.555, 'duration': 4.804}, {'end': 794.883, 'text': "I really don't need it, but it was all about illustration purposes for getting all of this stuff going.", 'start': 788.939, 'duration': 5.944}, {'end': 799.407, 'text': "Okay, so I'll CD back into my original project.", 'start': 795.624, 'duration': 3.783}, {'end': 803.211, 'text': 'And just go ahead and leave it at that.', 'start': 800.328, 'duration': 2.883}, {'end': 810.479, 'text': "Now, if any of this was confusing, and you're lost, rewatch the video and do this multiple times.", 'start': 804.753, 'duration': 5.726}], 'summary': 'Demonstrates creating a virtual environment and managing project folders.', 'duration': 30.326, 'max_score': 780.153, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U4780153.jpg'}], 'start': 129.662, 'title': 'Setting up python, django, and virtual environment', 'summary': 'Discusses setting up python and django, emphasizing the importance of following the refined installation process from joincfe.com, using a specific version of django (2.0.7), and creating and managing a virtual environment for django projects. it also provides guidance on addressing potential errors and using a code text editor for writing and managing code.', 'chapters': [{'end': 330.578, 'start': 129.662, 'title': 'Setting up python and django', 'summary': "Discusses setting up python and django, emphasizing the importance of following the refined installation process from joincfe.com and utilizing code from github, while highlighting the significance of consulting django's documentation and using google for comprehensive learning.", 'duration': 200.916, 'highlights': ['Setting up Python and Django involves following the refined installation process available on joincfe.com slash from zero, ensuring readiness for the subsequent series.', 'The code for the tutorials is available on GitHub at joincfe.com slash GitHub, specifically within the try Django repository, which is essential for troubleshooting and ensuring code consistency with the tutorial videos.', "Consulting Django's well-written documentation is crucial, as it provides additional context and specifics for various use cases of the technology, enhancing the learning process.", 'Using Google and resources like stackoverflow.com is recommended for comprehensive learning, allowing users to find answers to specific questions and gain insights about the technology and its scalability and concepts like null and blank.']}, {'end': 535.19, 'start': 331.542, 'title': 'Setting up virtual environment and installing django', 'summary': 'Discusses setting up a virtual environment and installing django using python on different platforms, emphasizing the importance of using a specific version of django (2.0.7) and addressing potential errors during the process.', 'duration': 203.648, 'highlights': ['The importance of using Django version 2.0.7 is emphasized, with a note on potential upgrades in the future.', 'Instructions for creating a virtual environment and installing Django using Python are provided for different platforms, with specific commands and version numbers.', 'Errors during the process are addressed, with a specific example of an error related to virtual environment and the recommended action.']}, {'end': 970.032, 'start': 535.75, 'title': 'Setting up virtual environment for django', 'summary': 'Explains the purpose of a virtual environment, demonstrates different ways of creating a virtual environment, and emphasizes the importance of using a virtual environment for django projects. it also provides guidance on reactivating a virtual environment and using pip freeze to manage package versions.', 'duration': 434.282, 'highlights': ['The purpose of having a virtual environment is to keep the requirements separate, as demonstrated by the difference in Django versions when using pip freeze (Django 1.10.4 and Django 2.0.7) while activating and deactivating the virtual environment.', "The chapter provides three different ways of creating a virtual environment: using 'virtualenv' command, specifying a Python version with 'virtualenv -p', and specifying the path to the Python version with 'virtualenv -p path'. It emphasizes the importance of choosing the appropriate method based on the system's default version or a specific Python version.", 'Emphasizes the importance of using a virtual environment for Django projects and provides guidance on reactivating a virtual environment and using pip freeze to manage package versions, ensuring the usage of the recommended Django version.']}, {'end': 1362.071, 'start': 970.132, 'title': 'Setting up django project in virtual environment', 'summary': 'Covers setting up a django project in a virtual environment, including creating a project, starting a server, and using a code text editor like sublime text for writing and managing code.', 'duration': 391.939, 'highlights': ['Setting up a Django project in a virtual environment', 'Using a code text editor like sublime text for writing and managing code', 'Starting a server and accessing Django landing page', 'Choosing a code text editor for Django project']}], 'duration': 1232.409, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U4129662.jpg', 'highlights': ['Setting up Python and Django involves following the refined installation process from joincfe.com', 'Using Django version 2.0.7 is emphasized for the setup', 'Creating and managing a virtual environment for Django projects is crucial', "Consulting Django's well-written documentation is recommended for additional context and specifics", 'Using Google and resources like stackoverflow.com is recommended for comprehensive learning', 'Instructions for creating a virtual environment and installing Django using Python are provided', 'The purpose of having a virtual environment is to keep the requirements separate', 'The chapter provides three different ways of creating a virtual environment', 'Emphasizes the importance of using a virtual environment for Django projects', 'Using a code text editor like sublime text for writing and managing code']}, {'end': 3514.205, 'segs': [{'end': 1769.561, 'src': 'embed', 'start': 1743.581, 'weight': 2, 'content': [{'end': 1751.405, 'text': "Three, I just said, Hey, database, make sure you and Django are hooked up and you're ready to start working.", 'start': 1743.581, 'duration': 7.824}, {'end': 1756.569, 'text': 'So if I actually change this to DB two, I could run migrate again.', 'start': 1752.125, 'duration': 4.444}, {'end': 1761.094, 'text': 'And what do you know Django actually creates a brand new database for me.', 'start': 1757.11, 'duration': 3.984}, {'end': 1764.497, 'text': 'Now this is pretty much only true with SQLite.', 'start': 1761.814, 'duration': 2.683}, {'end': 1769.561, 'text': 'If you had MySQL or PostgreSQL, you would have to create those databases themselves.', 'start': 1765.197, 'duration': 4.364}], 'summary': 'Django can create a new database with sqlite when migrating, unlike mysql or postgresql.', 'duration': 25.98, 'max_score': 1743.581, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U41743581.jpg'}, {'end': 2724.388, 'src': 'embed', 'start': 2700.917, 'weight': 0, 'content': [{'end': 2708.578, 'text': "And if I did that product dot objects at all, again, what I see here is a list, also known as query set, again, we'll get into that later.", 'start': 2700.917, 'duration': 7.661}, {'end': 2712.059, 'text': 'But it shows us all of those new products created.', 'start': 2709.478, 'duration': 2.581}, {'end': 2717.503, 'text': 'And Now assuming we still have our server running, which I do, you can close it out with Ctrl C.', 'start': 2712.079, 'duration': 5.424}, {'end': 2723.087, 'text': 'But if I just go ahead and make sure that my server is running, I can come back into my admin, right?', 'start': 2717.503, 'duration': 5.584}, {'end': 2724.388, 'text': 'So you log into your admin.', 'start': 2723.107, 'duration': 1.281}], 'summary': 'Demonstrating product creation and accessing via admin panel.', 'duration': 23.471, 'max_score': 2700.917, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U42700917.jpg'}, {'end': 2797.677, 'src': 'embed', 'start': 2767.447, 'weight': 4, 'content': [{'end': 2769.488, 'text': 'maybe it should just be one short field.', 'start': 2767.447, 'duration': 2.041}, {'end': 2774.532, 'text': "So there's definitely things that I need to change to this product model to make it better.", 'start': 2769.869, 'duration': 4.663}, {'end': 2777.734, 'text': "That's something we'll do in the next one by adding new fields.", 'start': 2774.912, 'duration': 2.822}, {'end': 2786.6, 'text': "So now what I'm gonna do is actually start over on these models, I really don't like what I did here.", 'start': 2781.776, 'duration': 4.824}, {'end': 2791.423, 'text': 'So in order for me to start over, I can delete all the files in the migrations folder.', 'start': 2787.1, 'duration': 4.323}, {'end': 2794.915, 'text': "and just leave in it in there, that's fine.", 'start': 2793.034, 'duration': 1.881}, {'end': 2797.677, 'text': 'Also delete pi cache if you have it there.', 'start': 2795.476, 'duration': 2.201}], 'summary': 'The speaker plans to make changes to the product model by adding new fields and starting over on the models by deleting files in the migrations folder and pi cache.', 'duration': 30.23, 'max_score': 2767.447, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U42767447.jpg'}, {'end': 3489.267, 'src': 'embed', 'start': 3464.264, 'weight': 1, 'content': [{'end': 3470.45, 'text': "Cool So now that I've got that, I come back in here, I refresh, summary is no longer bold.", 'start': 3464.264, 'duration': 6.186}, {'end': 3473.272, 'text': 'And I can now leave it empty in the database.', 'start': 3471.09, 'duration': 2.182}, {'end': 3479.558, 'text': 'So if I change blank equals to false, save it, again, run, make migrations.', 'start': 3474.013, 'duration': 5.545}, {'end': 3485.944, 'text': "And again, migrate, I can go back in here and refresh and notice now it says that it's bold.", 'start': 3479.858, 'duration': 6.086}, {'end': 3489.267, 'text': "So if I had save and continue, it'll give me this field is required.", 'start': 3486.144, 'duration': 3.123}], 'summary': 'Updating the database field to empty, results in a required field notice.', 'duration': 25.003, 'max_score': 3464.264, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U43464264.jpg'}], 'start': 1362.652, 'title': 'Django configuration, components, custom apps, model administration, and migrations', 'summary': 'Explains django configuration with key elements, covers fundamental components including custom app creation, model administration, and model changes with specific commands. it also demonstrates the process of running migrations and handling default and null values in the database.', 'chapters': [{'end': 1503.851, 'start': 1362.652, 'title': 'Django configuration explained', 'summary': 'Explains the key elements of django configuration, including the import of os, setting the base directory, understanding the secret key, and the importance of the debug setting in a django project.', 'duration': 141.199, 'highlights': ['The chapter explains the key elements of Django configuration, including the import of OS, setting the base directory, understanding the secret key, and the importance of the debug setting in a Django project.', 'The base dir variable is set to the path of the folder holding managed up high, allowing actions relative to Django inside the entire project.', 'The secret key is unique to each Django project and should not be made public in production to avoid security leaks.', 'The debug setting is useful during development and learning phases but should be handled differently in a live production environment.', "Importing the OS is crucial for ensuring Django's compatibility with various operating systems such as Windows, Mac, and Linux."]}, {'end': 2110.26, 'start': 1503.851, 'title': 'Understanding django components', 'summary': 'Covers fundamental components of django, including installed apps, middleware, root url conf, templates, wsgi application, databases, password validators, internationalization, and static files. it also demonstrates the process of creating a custom app and using the built-in admin component to manage users.', 'duration': 606.409, 'highlights': ['The chapter covers fundamental components of Django, including installed apps, middleware, root URL conf, templates, WSGI application, databases, password validators, internationalization, and static files.', 'Demonstrates the process of creating a custom app and using the built-in admin component to manage users.']}, {'end': 2442.072, 'start': 2110.78, 'title': 'Creating custom apps in django', 'summary': "Explains the process of creating custom apps in django, emphasizing the importance of narrow focus for each app and demonstrating the use of model fields to map data to the database, with specific commands like 'make migrations' and 'migrate' for updating the database schema.", 'duration': 331.292, 'highlights': ['The importance of narrow focus for each app', 'Demonstrating the use of model fields to map data to the database', "Specific commands like 'make migrations' and 'migrate' for updating the database schema"]}, {'end': 3019.163, 'start': 2442.833, 'title': 'Django model administration and python shell usage', 'summary': 'Covers the process of registering a model in the django admin using relative imports, creating and managing new products through the admin interface and python shell, and modifying the model fields to more realistic types, with a focus on char and decimal fields.', 'duration': 576.33, 'highlights': ['The process of registering a model in the Django admin using relative imports is demonstrated.', 'Creating and managing new products through the admin interface and Python shell is explained.', 'Modifying the model fields to more realistic types, with a focus on char and decimal fields, is discussed.']}, {'end': 3514.205, 'start': 3019.323, 'title': 'Django model changes and migrations', 'summary': 'Discusses making model changes and running migrations in a django project, including adding and modifying fields, running migrations, and handling default and null values in the database.', 'duration': 494.882, 'highlights': ['The process of making model changes and running migrations in a Django project is explained, including adding and modifying fields, running migrations, and handling default and null values in the database, with examples and commands provided (e.g., Python managed up py make migrations, Python managed up py migrate).', 'The implications of adding a new field to a model on existing database objects are discussed, along with the need to specify default values and handle null values, with an example of adding a Boolean field and setting default and null values to ensure database integrity.', "The impact of modifying model fields, such as making a field not required, on database and rendering behavior is demonstrated, with explanations of the 'blank' and 'null' attributes and their effects on the database and field rendering."]}], 'duration': 2151.553, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U41362652.jpg', 'highlights': ['The chapter covers fundamental components of Django, including installed apps, middleware, root URL conf, templates, WSGI application, databases, password validators, internationalization, and static files.', 'The process of making model changes and running migrations in a Django project is explained, including adding and modifying fields, running migrations, and handling default and null values in the database, with examples and commands provided (e.g., Python managed up py make migrations, Python managed up py migrate).', 'The process of registering a model in the Django admin using relative imports is demonstrated.', 'The chapter explains the key elements of Django configuration, including the import of OS, setting the base directory, understanding the secret key, and the importance of the debug setting in a Django project.', "Importing the OS is crucial for ensuring Django's compatibility with various operating systems such as Windows, Mac, and Linux."]}, {'end': 4180.45, 'segs': [{'end': 3540.447, 'src': 'embed', 'start': 3515.338, 'weight': 1, 'content': [{'end': 3520.3, 'text': 'Cool, so that is changing some items in the model.', 'start': 3515.338, 'duration': 4.962}, {'end': 3522.581, 'text': 'This used to be very, very hard.', 'start': 3521.16, 'duration': 1.421}, {'end': 3532.544, 'text': "And even if you feel like it's a little challenging doing this several times, breaking it, deleting the migrations in here, already,", 'start': 3522.621, 'duration': 9.923}, {'end': 3538.686, 'text': 'deleting the database, running all of that stuff all over again, doing that several times will really get you comfortable with models.', 'start': 3532.544, 'duration': 6.142}, {'end': 3540.447, 'text': 'I promise you it will.', 'start': 3539.326, 'duration': 1.121}], 'summary': 'Changing model items is now less challenging, leading to improved comfort with models.', 'duration': 25.109, 'max_score': 3515.338, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U43515338.jpg'}, {'end': 3930.956, 'src': 'heatmap', 'start': 3768.557, 'weight': 0, 'content': [{'end': 3770.078, 'text': 'And it says something about URLs.', 'start': 3768.557, 'duration': 1.521}, {'end': 3774.509, 'text': 'Well, this is where we actually wrap in our URLs.', 'start': 3771.004, 'duration': 3.505}, {'end': 3775.89, 'text': 'This is where URLs comes in.', 'start': 3774.529, 'duration': 1.361}, {'end': 3781.257, 'text': 'And when we went over the settings, we did mention about the URLs right here.', 'start': 3775.91, 'duration': 5.347}, {'end': 3790.227, 'text': 'So URLs are in try Django dot URLs, or otherwise, the settings module or the settings folder.', 'start': 3782.506, 'duration': 7.721}, {'end': 3794.888, 'text': 'Inside of URLs, this configuration folder has settings and URLs in there.', 'start': 3790.547, 'duration': 4.341}, {'end': 3801.189, 'text': "And it has one that we've already been using, which is admin, but that's the only path it actually has.", 'start': 3795.328, 'duration': 5.861}, {'end': 3807.99, 'text': 'So now what I want to do is actually import that view to work with my URLs.', 'start': 3801.909, 'duration': 6.081}, {'end': 3811.111, 'text': 'Now you already have some of this stuff in here.', 'start': 3809.131, 'duration': 1.98}, {'end': 3814.702, 'text': 'Right? So this is actually written for us.', 'start': 3812.58, 'duration': 2.122}, {'end': 3824.632, 'text': 'So I can go off of what they have written in a similar fashion by saying from pages, right, so pages would take place of my app, import views.', 'start': 3815.303, 'duration': 9.329}, {'end': 3829.797, 'text': 'And then I can quite literally add this URL pattern, like it says in the code.', 'start': 3825.292, 'duration': 4.505}, {'end': 3831.99, 'text': 'or in the comments there.', 'start': 3831.01, 'duration': 0.98}, {'end': 3833.691, 'text': "And I didn't call it home.", 'start': 3832.631, 'duration': 1.06}, {'end': 3835.392, 'text': 'But instead I called it home view.', 'start': 3833.731, 'duration': 1.661}, {'end': 3837.733, 'text': 'Right? So there we go.', 'start': 3836.092, 'duration': 1.641}, {'end': 3840.855, 'text': "I'm just going off of what they've given me home view.", 'start': 3837.893, 'duration': 2.962}, {'end': 3842.655, 'text': 'And home view.', 'start': 3841.735, 'duration': 0.92}, {'end': 3843.976, 'text': 'We save that.', 'start': 3843.296, 'duration': 0.68}, {'end': 3846.977, 'text': "And let's go back to our homepage.", 'start': 3845.477, 'duration': 1.5}, {'end': 3848.318, 'text': 'Hello world.', 'start': 3847.738, 'duration': 0.58}, {'end': 3850.754, 'text': "Cool, it's actually working.", 'start': 3849.232, 'duration': 1.522}, {'end': 3857.02, 'text': "There's a couple things that I don't particularly think is a good idea with how this is written.", 'start': 3851.695, 'duration': 5.325}, {'end': 3860.604, 'text': 'is that what if I wanted to use the product views then?', 'start': 3857.02, 'duration': 3.584}, {'end': 3863.947, 'text': 'and I went from products import views.', 'start': 3860.604, 'duration': 3.343}, {'end': 3866.371, 'text': 'things get confusing.', 'start': 3865.17, 'duration': 1.201}, {'end': 3868.353, 'text': "So don't do it this way.", 'start': 3866.952, 'duration': 1.401}, {'end': 3876.079, 'text': 'Go views, import home view, import the actual view that you want to use, and then just put that down there.', 'start': 3868.713, 'duration': 7.366}, {'end': 3878.221, 'text': 'Okay, so we save that.', 'start': 3876.84, 'duration': 1.381}, {'end': 3885.466, 'text': "And what do you know, the same exact response? Wow, that's fairly easy to work with.", 'start': 3878.581, 'duration': 6.885}, {'end': 3887.288, 'text': 'Not a whole lot going on here.', 'start': 3886.207, 'duration': 1.081}, {'end': 3897.35, 'text': "let's talk about URL patterns and how this portion works in conjunction with our view.", 'start': 3891.547, 'duration': 5.803}, {'end': 3903.412, 'text': "Now URL patterns, you notice that I had this empty string that's in this path.", 'start': 3898.11, 'duration': 5.302}, {'end': 3915.718, 'text': 'So if I actually copy this and paste it down here, and say, home, and put a slash at the very end of it, and save it, I can actually go into home.', 'start': 3904.293, 'duration': 11.425}, {'end': 3921.868, 'text': "And that same thing will come out where if I use a different page, like ABC, that won't show up.", 'start': 3916.178, 'duration': 5.69}, {'end': 3927.753, 'text': "And the page not found is because we haven't routed a path to that view.", 'start': 3922.528, 'duration': 5.225}, {'end': 3930.956, 'text': "Right? So let's say for instance, I want to call this contact.", 'start': 3928.434, 'duration': 2.522}], 'summary': 'The transcript discusses importing views and configuring url patterns in a django project.', 'duration': 162.399, 'max_score': 3768.557, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U43768557.jpg'}, {'end': 3897.35, 'src': 'embed', 'start': 3868.713, 'weight': 5, 'content': [{'end': 3876.079, 'text': 'Go views, import home view, import the actual view that you want to use, and then just put that down there.', 'start': 3868.713, 'duration': 7.366}, {'end': 3878.221, 'text': 'Okay, so we save that.', 'start': 3876.84, 'duration': 1.381}, {'end': 3885.466, 'text': "And what do you know, the same exact response? Wow, that's fairly easy to work with.", 'start': 3878.581, 'duration': 6.885}, {'end': 3887.288, 'text': 'Not a whole lot going on here.', 'start': 3886.207, 'duration': 1.081}, {'end': 3897.35, 'text': "let's talk about URL patterns and how this portion works in conjunction with our view.", 'start': 3891.547, 'duration': 5.803}], 'summary': 'Using go views and url patterns to work with views and responses.', 'duration': 28.637, 'max_score': 3868.713, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U43868713.jpg'}, {'end': 4140.298, 'src': 'embed', 'start': 4113.054, 'weight': 2, 'content': [{'end': 4119.18, 'text': "So that means that it actually is an argument that's coming through here, I can say request, and then args, keyword args, right.", 'start': 4113.054, 'duration': 6.126}, {'end': 4122.684, 'text': 'So each one has requests coming in here by default.', 'start': 4119.2, 'duration': 3.484}, {'end': 4127.627, 'text': 'So if I go back, refresh, now my args and keyword args are empty.', 'start': 4123.524, 'duration': 4.103}, {'end': 4130.491, 'text': 'And my request is absolutely in there.', 'start': 4128.189, 'duration': 2.302}, {'end': 4132.773, 'text': 'So I can print out that request.', 'start': 4130.551, 'duration': 2.222}, {'end': 4134.935, 'text': 'And we can see it.', 'start': 4133.934, 'duration': 1.001}, {'end': 4140.298, 'text': "And So what does this request do exactly? Well, there's a lot of different things that it can do.", 'start': 4134.955, 'duration': 5.343}], 'summary': 'The code processes requests and keyword arguments, with requests being default, and can perform various tasks.', 'duration': 27.244, 'max_score': 4113.054, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U44113054.jpg'}], 'start': 3515.338, 'title': 'Django development essentials', 'summary': 'Covers django models and views, explaining the process of changing model items, creating a custom homepage using views, and handling html responses. it also discusses handling urls and views, covering url configuration, importing views, creating url patterns, and capturing request arguments and keywords.', 'chapters': [{'end': 3745.715, 'start': 3515.338, 'title': 'Django models and views', 'summary': 'Covers the process of changing items in the model, getting comfortable with models by repeating the process, explaining the concepts to others, and creating a custom homepage using views in django, with an emphasis on the creation of a simple home view function and handling html responses.', 'duration': 230.377, 'highlights': ['Explaining the concepts to others and repeatedly working with models will help in getting comfortable with models.', 'Creating a custom homepage using views in Django, with an emphasis on the creation of a simple home view function and handling HTML responses.', "Adding the 'pages' app to the 'INSTALLED_APPS' in settings.py is recommended when creating new apps in Django."]}, {'end': 4180.45, 'start': 3746.235, 'title': 'Django: handling urls and views', 'summary': 'Discusses handling urls and views in django, covering topics such as url configuration, importing views, creating url patterns, and capturing request arguments and keywords.', 'duration': 434.215, 'highlights': ['URL configuration and path routing', 'Importing views and creating URL patterns', 'Capturing request arguments and keywords']}], 'duration': 665.112, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U43515338.jpg', 'highlights': ['Creating a custom homepage using views in Django, with an emphasis on the creation of a simple home view function and handling HTML responses.', 'Explaining the concepts to others and repeatedly working with models will help in getting comfortable with models.', "Adding the 'pages' app to the 'INSTALLED_APPS' in settings.py is recommended when creating new apps in Django.", 'URL configuration and path routing', 'Importing views and creating URL patterns', 'Capturing request arguments and keywords']}, {'end': 7076.397, 'segs': [{'end': 4470.378, 'src': 'heatmap', 'start': 4328.292, 'weight': 1, 'content': [{'end': 4334.735, 'text': "So that's how you would be able to return some sort of HTML template or HTML document, either way.", 'start': 4328.292, 'duration': 6.443}, {'end': 4337.877, 'text': 'So how do we actually find?', 'start': 4335.876, 'duration': 2.001}, {'end': 4344.1, 'text': 'How do I actually find this? Like, where is that located??', 'start': 4340.919, 'duration': 3.181}, {'end': 4348.781, 'text': 'If I save this and refresh in here, I get this error template does not exist.', 'start': 4344.2, 'duration': 4.581}, {'end': 4352.062, 'text': "Well, it certainly doesn't, we haven't actually created it, right.", 'start': 4349.281, 'duration': 2.781}, {'end': 4356.843, 'text': "And it's looking for it throughout our site, but it doesn't actually know where to go.", 'start': 4352.622, 'duration': 4.221}, {'end': 4359.323, 'text': 'So we need to create a location for it.', 'start': 4356.863, 'duration': 2.46}, {'end': 4360.403, 'text': "And that's what we'll do now.", 'start': 4359.523, 'duration': 0.88}, {'end': 4366.985, 'text': "Inside of our SRC folder in the root of the Django project, we're gonna make a new folder in here called templates.", 'start': 4360.984, 'duration': 6.001}, {'end': 4371.65, 'text': 'This folder is going to hold all of our templates as we see fit.', 'start': 4367.685, 'duration': 3.965}, {'end': 4378.061, 'text': "So inside of there we're going to go ahead and do home HTML making that new file.", 'start': 4372.15, 'duration': 5.911}, {'end': 4386.449, 'text': 'notice templates is online, with pages products and the Django configuration folder as well as managed up high.', 'start': 4378.061, 'duration': 8.388}, {'end': 4388.911, 'text': "So I'm gonna put a home dot html in there.", 'start': 4387.39, 'duration': 1.521}, {'end': 4390.593, 'text': "And I'm just gonna say h1.", 'start': 4389.432, 'duration': 1.161}, {'end': 4395.117, 'text': 'Hello, world, close off h1, and then do a p tag.', 'start': 4391.093, 'duration': 4.024}, {'end': 4397.018, 'text': 'This is a template.', 'start': 4395.657, 'duration': 1.361}, {'end': 4399.135, 'text': 'Close off that P tag.', 'start': 4398.254, 'duration': 0.881}, {'end': 4400.876, 'text': 'Okay, so we save that.', 'start': 4399.555, 'duration': 1.321}, {'end': 4402.697, 'text': 'Seems like things are looking good.', 'start': 4401.436, 'duration': 1.261}, {'end': 4405.119, 'text': "We made a templates folder, home.html's in there.", 'start': 4402.837, 'duration': 2.282}, {'end': 4407.26, 'text': 'We wanna render it out, save it.', 'start': 4405.719, 'duration': 1.541}, {'end': 4409.381, 'text': "Let's go back, rerun it.", 'start': 4408.101, 'duration': 1.28}, {'end': 4411.743, 'text': 'Hmm, template does not exist still.', 'start': 4409.902, 'duration': 1.841}, {'end': 4417.147, 'text': "Well, this is because we haven't actually set up Django to know where these templates are.", 'start': 4412.483, 'duration': 4.664}, {'end': 4422.711, 'text': "mean, I did name it templates, but that's an arbitrary name, that directory is an arbitrary name.", 'start': 4418.027, 'duration': 4.684}, {'end': 4426.994, 'text': 'It is a best practice name, but it is still, I just made it up.', 'start': 4423.271, 'duration': 3.723}, {'end': 4434.559, 'text': "Okay, so in settings, the pie, then, remember how I said we were going to come back to templates, if you watch that video, that's this.", 'start': 4427.394, 'duration': 7.165}, {'end': 4442.065, 'text': 'So we want to actually put in side of our doors, or our directories, where this directory location is.', 'start': 4435.06, 'duration': 7.005}, {'end': 4448.308, 'text': 'And Now I could hard code it to your path to templates.', 'start': 4442.085, 'duration': 6.223}, {'end': 4450.188, 'text': "And let's do that.", 'start': 4449.648, 'duration': 0.54}, {'end': 4452.61, 'text': "So let's go ahead and say pwd.", 'start': 4450.809, 'duration': 1.801}, {'end': 4455.611, 'text': 'Here is my normal project here.', 'start': 4453.41, 'duration': 2.201}, {'end': 4459.093, 'text': "Right? So that's to the root of the Django project.", 'start': 4456.191, 'duration': 2.902}, {'end': 4464.155, 'text': 'All I need to do is add templates here, as in the name of that folder, I hit save.', 'start': 4459.673, 'duration': 4.482}, {'end': 4470.378, 'text': "And refreshing here, what do you know, our templates are looking good, they're actually in there.", 'start': 4465.035, 'duration': 5.343}], 'summary': "Creating a 'templates' folder in the django project root resolved template errors.", 'duration': 142.086, 'max_score': 4328.292, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U44328292.jpg'}, {'end': 4417.147, 'src': 'embed', 'start': 4387.39, 'weight': 2, 'content': [{'end': 4388.911, 'text': "So I'm gonna put a home dot html in there.", 'start': 4387.39, 'duration': 1.521}, {'end': 4390.593, 'text': "And I'm just gonna say h1.", 'start': 4389.432, 'duration': 1.161}, {'end': 4395.117, 'text': 'Hello, world, close off h1, and then do a p tag.', 'start': 4391.093, 'duration': 4.024}, {'end': 4397.018, 'text': 'This is a template.', 'start': 4395.657, 'duration': 1.361}, {'end': 4399.135, 'text': 'Close off that P tag.', 'start': 4398.254, 'duration': 0.881}, {'end': 4400.876, 'text': 'Okay, so we save that.', 'start': 4399.555, 'duration': 1.321}, {'end': 4402.697, 'text': 'Seems like things are looking good.', 'start': 4401.436, 'duration': 1.261}, {'end': 4405.119, 'text': "We made a templates folder, home.html's in there.", 'start': 4402.837, 'duration': 2.282}, {'end': 4407.26, 'text': 'We wanna render it out, save it.', 'start': 4405.719, 'duration': 1.541}, {'end': 4409.381, 'text': "Let's go back, rerun it.", 'start': 4408.101, 'duration': 1.28}, {'end': 4411.743, 'text': 'Hmm, template does not exist still.', 'start': 4409.902, 'duration': 1.841}, {'end': 4417.147, 'text': "Well, this is because we haven't actually set up Django to know where these templates are.", 'start': 4412.483, 'duration': 4.664}], 'summary': 'The transcript involves setting up a home.html template in a templates folder, encountering an issue with template existence due to django configuration.', 'duration': 29.757, 'max_score': 4387.39, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U44387390.jpg'}, {'end': 4906.741, 'src': 'embed', 'start': 4878.746, 'weight': 0, 'content': [{'end': 4885.211, 'text': 'If I saved it just like that, and went into that about page, it just says replace me.', 'start': 4878.746, 'duration': 6.465}, {'end': 4889.753, 'text': "Ah, so so it's rendering out this default page.", 'start': 4886.551, 'duration': 3.202}, {'end': 4890.753, 'text': "That's all it's doing.", 'start': 4889.793, 'duration': 0.96}, {'end': 4900.258, 'text': 'So in order for me to actually replace whatever block is in there, I have to use it, I do block content, curly bracket.', 'start': 4891.434, 'duration': 8.824}, {'end': 4904.18, 'text': 'So curly brackets percent block, that is the Django related stuff.', 'start': 4900.298, 'duration': 3.882}, {'end': 4906.741, 'text': 'Content is a variable that I created.', 'start': 4904.74, 'duration': 2.001}], 'summary': 'To replace the default content, use block and content as variables in django templates.', 'duration': 27.995, 'max_score': 4878.746, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U44878746.jpg'}, {'end': 5379.261, 'src': 'embed', 'start': 5350.939, 'weight': 13, 'content': [{'end': 5352.721, 'text': "That's a standard thing in Python.", 'start': 5350.939, 'duration': 1.782}, {'end': 5360.609, 'text': "And then I can use a string as the value or I could use something else like number or rather, let's say something more like my number.", 'start': 5353.202, 'duration': 7.407}, {'end': 5364.292, 'text': 'And we could do 123.', 'start': 5361.89, 'duration': 2.402}, {'end': 5365.855, 'text': 'Right So I can use strings.', 'start': 5364.292, 'duration': 1.563}, {'end': 5367.578, 'text': 'I can use numbers.', 'start': 5366.155, 'duration': 1.423}, {'end': 5373.709, 'text': "I can use other dictionaries, which I'll let you play around with the data types yourself, because that's not really what's important.", 'start': 5367.758, 'duration': 5.951}, {'end': 5377.295, 'text': "What's important is how we actually bring this into context.", 'start': 5373.749, 'duration': 3.546}, {'end': 5379.261, 'text': 'into this about page.', 'start': 5378.241, 'duration': 1.02}], 'summary': 'Python allows using strings, numbers, and dictionaries as values, enabling versatile data manipulation and context creation.', 'duration': 28.322, 'max_score': 5350.939, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U45350939.jpg'}, {'end': 6353.482, 'src': 'embed', 'start': 6322.344, 'weight': 14, 'content': [{'end': 6326.266, 'text': 'But what you can do is you can absolutely use two things at once.', 'start': 6322.344, 'duration': 3.922}, {'end': 6331.109, 'text': 'So I can say cat first, right, so I can filter that into cat first, like it does.', 'start': 6326.326, 'duration': 4.783}, {'end': 6338.853, 'text': 'But then maybe we use the upper case with just upper, so slash upper.', 'start': 6331.949, 'duration': 6.904}, {'end': 6344.517, 'text': "And all that's gonna do is capitalize the first letter and then uppercase all the other ones right?", 'start': 6339.855, 'duration': 4.662}, {'end': 6347.479, 'text': 'So we can stack those filters together, which is kind of nice.', 'start': 6344.537, 'duration': 2.942}, {'end': 6353.482, 'text': "Now, I'm not sure exactly when you're gonna be stacking these together like this, but it is possible.", 'start': 6348.179, 'duration': 5.303}], 'summary': 'You can stack filters together to capitalize and uppercase letters, allowing for multiple functions at once.', 'duration': 31.138, 'max_score': 6322.344, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U46322344.jpg'}, {'end': 6410.851, 'src': 'embed', 'start': 6380.149, 'weight': 9, 'content': [{'end': 6382.69, 'text': "So it doesn't actually render the HTML document.", 'start': 6380.149, 'duration': 2.541}, {'end': 6386.412, 'text': 'Right? So we can actually use a filter in here called safe.', 'start': 6383.57, 'duration': 2.842}, {'end': 6387.993, 'text': 'So we can save that.', 'start': 6387.232, 'duration': 0.761}, {'end': 6390.874, 'text': 'And there you go, it actually renders that HTML.', 'start': 6388.613, 'duration': 2.261}, {'end': 6397.283, 'text': "And there's a lot more like truncate characters, right or title look at Hey, that's pretty cool.", 'start': 6391.975, 'duration': 5.308}, {'end': 6400.825, 'text': "So how about we do that? We've got cat first and then title.", 'start': 6397.803, 'duration': 3.022}, {'end': 6410.851, 'text': 'So title and title, a title, it title izes the entire title variable, right? So this is the variable, whatever that is, is the variable.', 'start': 6401.566, 'duration': 9.285}], 'summary': "Using 'safe' filter renders html, 'truncate' and 'title' functions are demonstrated.", 'duration': 30.702, 'max_score': 6380.149, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U46380149.jpg'}, {'end': 6495.269, 'src': 'embed', 'start': 6468.873, 'weight': 1, 'content': [{'end': 6474.354, 'text': 'And hey, what do you know? It removed all those HTML tags and slugified it at the same time.', 'start': 6468.873, 'duration': 5.481}, {'end': 6481.999, 'text': "So you're gonna wanna go to the documentation for this whenever you think like hey, I need to do X, Y or Z,", 'start': 6475.134, 'duration': 6.865}, {'end': 6487.223, 'text': "because they're very specific to just generally what you're using, right?", 'start': 6481.999, 'duration': 5.224}, {'end': 6492.727, 'text': 'So if you have user generated content and you want their titles show up as a title, then you might do that.', 'start': 6487.243, 'duration': 5.484}, {'end': 6495.269, 'text': 'But honestly, you might leave it as is.', 'start': 6493.208, 'duration': 2.061}], 'summary': 'Documentation provides specific guidance for removing html tags and slugifying content.', 'duration': 26.396, 'max_score': 6468.873, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U46468873.jpg'}, {'end': 6604.673, 'src': 'embed', 'start': 6578.089, 'weight': 6, 'content': [{'end': 6585.941, 'text': "Also, I'm assuming that you have this exact model, our product model, you can have any model you want, but make sure you have one model.", 'start': 6578.089, 'duration': 7.852}, {'end': 6592.19, 'text': "And I'm going to go ahead and import that from products, dot models, import product.", 'start': 6586.762, 'duration': 5.428}, {'end': 6598.47, 'text': "Okay, so if you're not familiar with how these imports work, might want to go back a little bit.", 'start': 6593.587, 'duration': 4.883}, {'end': 6604.673, 'text': "But basically, we're going from that app, looking at that model, module, model module, that's a mouthful.", 'start': 6598.51, 'duration': 6.163}], 'summary': 'Import the product model from products, dot models, making sure to have one model.', 'duration': 26.584, 'max_score': 6578.089, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U46578089.jpg'}, {'end': 6710.688, 'src': 'embed', 'start': 6683.237, 'weight': 7, 'content': [{'end': 6688.639, 'text': "Hopefully you're wondering where the heck did ID come from? And this get call? We'll explain that in a little bit.", 'start': 6683.237, 'duration': 5.402}, {'end': 6690.94, 'text': "But let's go ahead and exit out of the shell for now.", 'start': 6688.699, 'duration': 2.241}, {'end': 6696.642, 'text': "And let's go ahead and create our first view where we're rendering out this actual data.", 'start': 6691.64, 'duration': 5.002}, {'end': 6701.324, 'text': "So whatever this data is, so I'm gonna open up my views inside of the product app again.", 'start': 6696.702, 'duration': 4.622}, {'end': 6710.688, 'text': "And I mean the reason I'm moving it out of the view of this other one, if you've been following along, has to do with congruency, right?", 'start': 6702.744, 'duration': 7.944}], 'summary': 'Explanation of id and get call, creating first view to render data.', 'duration': 27.451, 'max_score': 6683.237, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U46683237.jpg'}, {'end': 6983.909, 'src': 'embed', 'start': 6933.975, 'weight': 4, 'content': [{'end': 6936.257, 'text': 'Of course, this is continuing from previous videos.', 'start': 6933.975, 'duration': 2.282}, {'end': 6937.318, 'text': 'So make sure you watch those.', 'start': 6936.277, 'duration': 1.041}, {'end': 6943.502, 'text': 'And when you block content, and we do just in block, there we go.', 'start': 6937.878, 'duration': 5.624}, {'end': 6951.348, 'text': "That standard, we've created our template, let's go ahead and make sure we import our view to our URLs.", 'start': 6945.964, 'duration': 5.384}, {'end': 6956.038, 'text': "And in our URLs, we're going to go ahead and import the product view.", 'start': 6951.408, 'duration': 4.63}, {'end': 6964.704, 'text': "So we'll do from products dot views, import product, detail, view, that's the name of the view, of course.", 'start': 6956.058, 'duration': 8.646}, {'end': 6968.066, 'text': "And then finally, I'm just going to go ahead and make a new path here.", 'start': 6965.524, 'duration': 2.542}, {'end': 6969.967, 'text': "And we'll call it product.", 'start': 6968.726, 'duration': 1.241}, {'end': 6972.629, 'text': 'And it just takes in product detail view.', 'start': 6970.708, 'duration': 1.921}, {'end': 6978.533, 'text': "Cool And I'm just gonna go ahead and do an h1 here and say item.", 'start': 6973.55, 'duration': 4.983}, {'end': 6983.909, 'text': "Okay, So let's go back into our project, go into product.", 'start': 6979.734, 'duration': 4.175}], 'summary': 'Continuing from previous videos, importing product view and creating a new path for product detail view.', 'duration': 49.934, 'max_score': 6933.975, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U46933975.jpg'}], 'start': 4180.47, 'title': 'Improving webpage with django templating', 'summary': 'Discusses improving a basic webpage with django templating, including creating and rendering html templates, setting up template directories, and leveraging inheritance. it also covers template inheritance, context, django template tags, and rendering data from the django backend.', 'chapters': [{'end': 4669.095, 'start': 4180.47, 'title': 'Improving webpage with django templating', 'summary': 'Discusses the process of improving a basic webpage by introducing django templating, including creating and rendering html templates, setting up template directories, and leveraging inheritance with django templates.', 'duration': 488.625, 'highlights': ['Explaining the process of returning HTML templates using Django render', 'Setting up the template directory and configuring it in the settings.py file', 'Illustrating the use of OS-independent method for defining the template directory path', 'Utilizing user model and authentication in Django templating engine']}, {'end': 5952.75, 'start': 4669.835, 'title': 'Template inheritance and context in django', 'summary': 'Discusses template inheritance and context in django, highlighting the use of template inheritance to create a root page for other pages, the inclusion of a navigation bar and metadata across different html pages, and the utilization of template context to pass data to templates. it also covers the use of for loops to iterate through context variables and provides insights on handling conditions in templates.', 'duration': 1282.915, 'highlights': ['The chapter discusses template inheritance and the creation of a root page for other pages.', 'The inclusion of a navigation bar and metadata across different HTML pages is highlighted.', 'The utilization of template context to pass data to templates is discussed.', 'The use of for loops to iterate through context variables is explained.', 'Insights on handling conditions in templates are provided.']}, {'end': 6531.67, 'start': 5952.81, 'title': 'Django template tags', 'summary': 'Discusses the usage of if-else conditions, built-in template tag filters, and various built-in template tags in django, including examples and practical use cases.', 'duration': 578.86, 'highlights': ['The chapter discusses the usage of if-else conditions and the ability to render specific content based on condition evaluation.', 'It explains the usage of built-in template tag filters, including examples such as cap first, upper, safe, strip tags, and slugify.', 'It also covers the usage of various built-in template tags in Django, including extends, block, for loop, if, and include.']}, {'end': 7076.397, 'start': 6532.771, 'title': 'Rendering data from django backend', 'summary': 'Covers accessing and rendering data from the django backend, including using the shell to access data, creating a view to render the data, and creating a template to display the data from the database.', 'duration': 543.626, 'highlights': ['Accessing data using Python shell to understand how to access and manipulate data from the database.', 'Creating a view to render data and explaining the naming convention for the view function.', 'Creating a template to display data from the database and using conditions to handle missing data.']}], 'duration': 2895.927, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U44180470.jpg', 'highlights': ['Utilizing user model and authentication in Django templating engine', 'Creating a view to render data and explaining the naming convention for the view function', 'The chapter discusses the usage of if-else conditions and the ability to render specific content based on condition evaluation', 'The chapter discusses template inheritance and the creation of a root page for other pages', 'The inclusion of a navigation bar and metadata across different HTML pages is highlighted', 'Explaining the process of returning HTML templates using Django render', 'Setting up the template directory and configuring it in the settings.py file', 'Illustrating the use of OS-independent method for defining the template directory path', 'The utilization of template context to pass data to templates is discussed', 'The use of for loops to iterate through context variables is explained', 'Insights on handling conditions in templates are provided', 'It explains the usage of built-in template tag filters, including examples such as cap first, upper, safe, strip tags, and slugify', 'It also covers the usage of various built-in template tags in Django, including extends, block, for loop, if, and include', 'Accessing data using Python shell to understand how to access and manipulate data from the database', 'Creating a template to display data from the database and using conditions to handle missing data']}, {'end': 7923.264, 'segs': [{'end': 7142.885, 'src': 'embed', 'start': 7119.457, 'weight': 3, 'content': [{'end': 7127.959, 'text': 'But it adds an extra step like, meaning if I ever change my model, or I want to have new data in my HTML, I also have to go in my view.', 'start': 7119.457, 'duration': 8.502}, {'end': 7129.36, 'text': "And that's a little inefficient.", 'start': 7128.059, 'duration': 1.301}, {'end': 7133.801, 'text': 'So what we want to do instead, is instead of all this, just get rid of that.', 'start': 7129.4, 'duration': 4.401}, {'end': 7135.102, 'text': "Or let's just comment it out.", 'start': 7134.041, 'duration': 1.061}, {'end': 7137.843, 'text': "I'll leave it in there for for reference for you guys.", 'start': 7135.162, 'duration': 2.681}, {'end': 7139.163, 'text': 'So we do content.', 'start': 7138.263, 'duration': 0.9}, {'end': 7142.885, 'text': 'And we say object is obj.', 'start': 7139.543, 'duration': 3.342}], 'summary': 'Proposing to remove an inefficient step from the process, simplifying by eliminating the extra step in the model-view interaction.', 'duration': 23.428, 'max_score': 7119.457, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U47119457.jpg'}, {'end': 7336.269, 'src': 'embed', 'start': 7294.114, 'weight': 2, 'content': [{'end': 7298.536, 'text': "So I'm going to just call this one in app template with that title there.", 'start': 7294.114, 'duration': 4.422}, {'end': 7304.959, 'text': 'All this is for is illustrating the difference and understanding how Django looks up templates themselves.', 'start': 7299.677, 'duration': 5.282}, {'end': 7315.233, 'text': "So we save this and in our view, I'm going to change this to products detail, not the exact thing, because I want to show you something.", 'start': 7305.699, 'duration': 9.534}, {'end': 7318.097, 'text': 'you can jump ahead and go to the exact same, but I want to show you something.', 'start': 7315.233, 'duration': 2.864}, {'end': 7323.904, 'text': "So if I save that, what's gonna happen is I render this page out, and I get an error saying template does not exist.", 'start': 7318.137, 'duration': 5.767}, {'end': 7328.688, 'text': 'So this is actually pretty important to understand,', 'start': 7324.747, 'duration': 3.941}, {'end': 7333.949, 'text': 'because a lot of times you put templates in the wrong place or you have a spelling error or something like that.', 'start': 7328.688, 'duration': 5.261}, {'end': 7336.269, 'text': "This allows me to see what's going on.", 'start': 7334.529, 'duration': 1.74}], 'summary': 'Illustrating django template lookup with an error', 'duration': 42.155, 'max_score': 7294.114, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U47294114.jpg'}, {'end': 7903.136, 'src': 'embed', 'start': 7878.861, 'weight': 0, 'content': [{'end': 7886.528, 'text': 'And Okay, these things we will absolutely discuss when we break this down and go from bare minimum.', 'start': 7878.861, 'duration': 7.667}, {'end': 7891.85, 'text': 'I just wanted to show you how to do it first, hopefully to pique your interest to learn a lot more about this.', 'start': 7886.528, 'duration': 5.322}, {'end': 7892.471, 'text': "That's the point.", 'start': 7891.89, 'duration': 0.581}, {'end': 7896.672, 'text': "Okay, so I refresh in here, let's get rid of all that stuff in the URL.", 'start': 7893.151, 'duration': 3.521}, {'end': 7898.773, 'text': "And I'll just do new product again.", 'start': 7897.232, 'duration': 1.541}, {'end': 7900.994, 'text': "And description doesn't matter.", 'start': 7899.613, 'duration': 1.381}, {'end': 7903.136, 'text': 'price 1299.', 'start': 7902.776, 'duration': 0.36}], 'summary': 'Demonstrates how to add a new product with a price of 1299.', 'duration': 24.275, 'max_score': 7878.861, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U47878861.jpg'}], 'start': 7076.637, 'title': 'Django templates and model forms', 'summary': 'Discusses the disadvantages of mapping every field of an object to the context in a view, and proposes a more efficient method by using context object mapping. it also explains the importance of organizing django app components, creating and organizing templates, and the basics of using django model forms, with a focus on rendering and saving data, while highlighting the relevance of keeping apps reusable and accessible within projects.', 'chapters': [{'end': 7185.644, 'start': 7076.637, 'title': 'Context object mapping', 'summary': 'Discusses the disadvantage of mapping every field of an object to the context in a view, and proposes a more efficient method by using context object mapping.', 'duration': 109.007, 'highlights': ['The disadvantage of mapping every field of an object to the context in a view is highlighted, as it adds an extra step when changing the model or adding new data to the HTML.', 'The proposed efficient method of context object mapping is introduced, allowing for easier template changes without worrying about the detail view.', 'The process of using context object mapping to access object fields in the detail view is explained, emphasizing the flexibility it provides for template adjustments.']}, {'end': 7923.264, 'start': 7186.125, 'title': 'Understanding django templates and model forms', 'summary': 'Explains the importance of organizing django app components, the process of creating and organizing templates, and the basics of using django model forms, with a focus on rendering and saving data. it also highlights the relevance of keeping apps reusable and accessible within projects.', 'duration': 737.139, 'highlights': ['The chapter explains the importance of organizing Django app components to keep them simple and reusable in other projects.', 'The process of creating and organizing templates is detailed, including the steps to create a new folder for templates within the app and understanding how Django looks up templates.', 'The basics of using Django model forms, focusing on rendering and saving data, are introduced, with a demonstration of creating a new form and rendering it in a view.']}], 'duration': 846.627, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U47076637.jpg', 'highlights': ['The proposed efficient method of context object mapping is introduced, allowing for easier template changes without worrying about the detail view.', 'The process of using context object mapping to access object fields in the detail view is explained, emphasizing the flexibility it provides for template adjustments.', 'The chapter explains the importance of organizing Django app components to keep them simple and reusable in other projects.', 'The process of creating and organizing templates is detailed, including the steps to create a new folder for templates within the app and understanding how Django looks up templates.', 'The basics of using Django model forms, focusing on rendering and saving data, are introduced, with a demonstration of creating a new form and rendering it in a view.', 'The disadvantage of mapping every field of an object to the context in a view is highlighted, as it adds an extra step when changing the model or adding new data to the HTML.']}, {'end': 8745.47, 'segs': [{'end': 7949.438, 'src': 'embed', 'start': 7924.365, 'weight': 0, 'content': [{'end': 7933.209, 'text': "So to actually overcome this for now, what I'm going to do is just add in a default of true or a default of false.", 'start': 7924.365, 'duration': 8.844}, {'end': 7937.991, 'text': "Either way, that part doesn't matter, but we made some changes to our models.", 'start': 7933.689, 'duration': 4.302}, {'end': 7939.532, 'text': 'So what do we do? Python managed up.', 'start': 7938.111, 'duration': 1.421}, {'end': 7941.513, 'text': 'Why make migrations? Oops.', 'start': 7939.692, 'duration': 1.821}, {'end': 7944.834, 'text': "We want to make sure we're in the root of our project where Python managed up.", 'start': 7941.573, 'duration': 3.261}, {'end': 7949.438, 'text': 'Why is make migrations and Python manage.py migrate.', 'start': 7944.854, 'duration': 4.584}], 'summary': 'Changes to models made for migrations and migration management in python.', 'duration': 25.073, 'max_score': 7924.365, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U47924365.jpg'}, {'end': 8222.657, 'src': 'embed', 'start': 8170.309, 'weight': 3, 'content': [{'end': 8177.894, 'text': 'So if I change that method to get what happens, I refresh and say ABC, hit save.', 'start': 8170.309, 'duration': 7.585}, {'end': 8180.192, 'text': 'It seems like something happened.', 'start': 8179.031, 'duration': 1.161}, {'end': 8183.555, 'text': 'But what you might have noticed is the URL changed.', 'start': 8180.252, 'duration': 3.303}, {'end': 8189.96, 'text': 'You see get methods are what is the default method for a form.', 'start': 8184.336, 'duration': 5.624}, {'end': 8196.966, 'text': 'So if I just typed out a form like this, and rendered it and said something else, it will change the URL.', 'start': 8190.541, 'duration': 6.425}, {'end': 8201.51, 'text': 'This is actually very similar to like when you want to do a search on your website.', 'start': 8197.687, 'duration': 3.823}, {'end': 8211.356, 'text': 'But instead of doing a search, and you know, going into the nitty gritty of that, what we are going to do is keep that method of post.', 'start': 8202.271, 'duration': 9.085}, {'end': 8218.457, 'text': 'Okay, so we save that and then refresh, try ABC again, and we get this forbidden yet again.', 'start': 8211.376, 'duration': 7.081}, {'end': 8222.657, 'text': 'Now this has to do with security measures that Django has built in.', 'start': 8218.977, 'duration': 3.68}], 'summary': 'Changing form method to post triggers security measures in django.', 'duration': 52.348, 'max_score': 8170.309, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U48170309.jpg'}, {'end': 8297.75, 'src': 'embed', 'start': 8247.492, 'weight': 2, 'content': [{'end': 8256.174, 'text': 'whoa, what happens, it takes me to a different URL, as well as a different, you know, also including that data that I actually put in.', 'start': 8247.492, 'duration': 8.682}, {'end': 8261.976, 'text': 'So action then means that you can send it to a completely different URL.', 'start': 8257.135, 'duration': 4.841}, {'end': 8271.439, 'text': "So what if I did the same thing with like Google, so www.google.com slash search, I'm actually gonna get rid of that trailing slash there.", 'start': 8262.456, 'duration': 8.983}, {'end': 8274.139, 'text': "And I'm also going to change the name here to Q.", 'start': 8272.019, 'duration': 2.12}, {'end': 8279.12, 'text': 'And then it will just say your search, we save that.', 'start': 8274.139, 'duration': 4.981}, {'end': 8286.343, 'text': "And we refresh in here, we've got your search, and I'll do Django CFE, hit save.", 'start': 8280.361, 'duration': 5.982}, {'end': 8291.385, 'text': 'Hey, what do you know, I actually performed a Google search right there.', 'start': 8287.644, 'duration': 3.741}, {'end': 8295.467, 'text': "And what's pretty cool is coding for entrepreneurs came up a lot.", 'start': 8291.986, 'duration': 3.481}, {'end': 8296.568, 'text': "And That's awesome.", 'start': 8295.486, 'duration': 1.082}, {'end': 8297.75, 'text': 'I like seeing that.', 'start': 8297.15, 'duration': 0.6}], 'summary': 'Demonstrating redirecting to a different url and performing a google search with modified parameters.', 'duration': 50.258, 'max_score': 8247.492, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U48247492.jpg'}, {'end': 8403.61, 'src': 'embed', 'start': 8372.054, 'weight': 1, 'content': [{'end': 8374.976, 'text': 'And again, I get that forbidden call once again.', 'start': 8372.054, 'duration': 2.922}, {'end': 8380.62, 'text': 'So to override that problem, we do CS RF token.', 'start': 8375.536, 'duration': 5.084}, {'end': 8384.923, 'text': 'Okay, so we save that and we refresh in here.', 'start': 8380.639, 'duration': 4.284}, {'end': 8390.438, 'text': "Confirm form resubmission, we can say yes, let's try it again.", 'start': 8386.004, 'duration': 4.434}, {'end': 8392.58, 'text': 'And there we go.', 'start': 8390.458, 'duration': 2.122}, {'end': 8393.601, 'text': 'So it actually goes away.', 'start': 8392.84, 'duration': 0.761}, {'end': 8395.903, 'text': 'So the data seems to be going through.', 'start': 8394.442, 'duration': 1.461}, {'end': 8398.826, 'text': 'Now what the heck is get in post.', 'start': 8396.764, 'duration': 2.062}, {'end': 8403.61, 'text': 'Now get request is meaning that you go to any URL.', 'start': 8400.067, 'duration': 3.543}], 'summary': 'Resolving forbidden call with cs rf token, successfully completing data transmission.', 'duration': 31.556, 'max_score': 8372.054, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U48372054.jpg'}, {'end': 8581.915, 'src': 'embed', 'start': 8544.124, 'weight': 4, 'content': [{'end': 8547.327, 'text': 'It starts to bring up all sorts of security questions that you may have.', 'start': 8544.124, 'duration': 3.203}, {'end': 8554.733, 'text': "So instead of doing that, we use request post, right? So I'm gonna get rid of this part of the get call.", 'start': 8548.067, 'duration': 6.666}, {'end': 8558.196, 'text': 'And then inside of my form, I still have it at post.', 'start': 8555.414, 'duration': 2.782}, {'end': 8564.181, 'text': 'So I can get rid of all that and do ABC, hit save.', 'start': 8559.457, 'duration': 4.724}, {'end': 8567.965, 'text': 'And now what I see is all of that data coming through.', 'start': 8564.902, 'duration': 3.063}, {'end': 8570.067, 'text': 'Pretty cool.', 'start': 8569.626, 'duration': 0.441}, {'end': 8581.915, 'text': 'So that means the very last part of this is I can actually come in here and and say title equals to request that post that get title.', 'start': 8570.527, 'duration': 11.388}], 'summary': 'Using request post instead of get to enhance security, resulting in successful data transmission.', 'duration': 37.791, 'max_score': 8544.124, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U48544124.jpg'}], 'start': 7924.365, 'title': 'Django form security', 'summary': 'Discusses the importance of using post requests for form security, the vulnerabilities of using get requests, and the risks of not validating and cleaning data in django, emphasizing the need for proper data validation and cleaning. it also covers making changes to models using python manage.py, solving problems with data rendering, and understanding form methods and security measures, as well as creating a google search form in django, explaining the action and method attributes, and the difference between get and post requests, with specific examples and explanations.', 'chapters': [{'end': 8274.139, 'start': 7924.365, 'title': 'Django forms and model forms', 'summary': 'Discusses making changes to models using python manage.py, solving problems with data rendering, and understanding form methods and security measures in django.', 'duration': 349.774, 'highlights': ['The chapter discusses making changes to models using Python manage.py', 'Solving problems with data rendering', 'Understanding form methods and security measures in Django']}, {'end': 8491.776, 'start': 8274.139, 'title': 'Creating google search form in django', 'summary': 'Demonstrates creating a google search form in django, explaining the action and method attributes, as well as the difference between get and post requests, with specific examples and explanations.', 'duration': 217.637, 'highlights': ['The action attribute in the form sends the form data to the specified URL, impacting the functionality of the form, as changing it resulted in a 405 error and a forbidden call, demonstrating the practical implications of modifying the action attribute.', 'Understanding the difference between GET and POST requests, with a clear analogy of GET being used to retrieve information from a URL and POST to save information in the backend, is explained through practical examples and analogies.', 'The backend treats both GET and POST requests similarly, as demonstrated in the actual view, where both types of requests can be handled and examined using the request object, providing insights into the backend handling of different request types.']}, {'end': 8745.47, 'start': 8492.437, 'title': 'Django form security', 'summary': 'Discusses the importance of using post requests for form security in django, the vulnerabilities of using get requests, and the risks of not validating and cleaning data, emphasizing the need for proper data validation and cleaning.', 'duration': 253.033, 'highlights': ['The importance of using post requests for form security in Django, to prevent security vulnerabilities and unauthorized data modification.', 'The risks of using get requests, which can lead to security vulnerabilities and unauthorized data modification.', 'The significance of validating and cleaning data to ensure data integrity and security.', 'The potential security risks of not validating and cleaning data, leading to poor data integrity and security.']}], 'duration': 821.105, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U47924365.jpg', 'highlights': ['The importance of using post requests for form security in Django, to prevent security vulnerabilities and unauthorized data modification.', 'The risks of using get requests, which can lead to security vulnerabilities and unauthorized data modification.', 'The significance of validating and cleaning data to ensure data integrity and security.', 'Understanding the difference between GET and POST requests, with a clear analogy of GET being used to retrieve information from a URL and POST to save information in the backend, is explained through practical examples and analogies.', 'The backend treats both GET and POST requests similarly, as demonstrated in the actual view, where both types of requests can be handled and examined using the request object, providing insights into the backend handling of different request types.', 'The action attribute in the form sends the form data to the specified URL, impacting the functionality of the form, as changing it resulted in a 405 error and a forbidden call, demonstrating the practical implications of modifying the action attribute.', 'The chapter discusses making changes to models using Python manage.py', 'Solving problems with data rendering', 'Understanding form methods and security measures in Django']}, {'end': 9389.86, 'segs': [{'end': 8938.396, 'src': 'heatmap', 'start': 8800.3, 'weight': 0.933, 'content': [{'end': 8803.201, 'text': 'So these should look very similar to our models.', 'start': 8800.3, 'duration': 2.901}, {'end': 8804.842, 'text': "And that's because they are.", 'start': 8804.001, 'duration': 0.841}, {'end': 8809.383, 'text': "So we've got a decimal field char field and our we don't actually have text field.", 'start': 8805.542, 'duration': 3.841}, {'end': 8811.344, 'text': "So if you try to do text field, it's not going to work.", 'start': 8809.403, 'duration': 1.941}, {'end': 8813.124, 'text': "I'll discuss that later.", 'start': 8811.664, 'duration': 1.46}, {'end': 8814.925, 'text': "But we'll just do char field.", 'start': 8813.764, 'duration': 1.161}, {'end': 8819.466, 'text': 'And honestly, if you wanted some reference for that, you just do Django form fields.', 'start': 8815.205, 'duration': 4.261}, {'end': 8822.487, 'text': 'And it should give you the field types in here.', 'start': 8820.366, 'duration': 2.121}, {'end': 8827.325, 'text': 'So form fields, all of the various field types are in here.', 'start': 8823.803, 'duration': 3.522}, {'end': 8831.367, 'text': 'So you can absolutely use any of those.', 'start': 8828.986, 'duration': 2.381}, {'end': 8834.089, 'text': 'But, you know, text field is not there.', 'start': 8831.868, 'duration': 2.221}, {'end': 8838.772, 'text': 'So these all render out a specific look by default.', 'start': 8835.57, 'duration': 3.202}, {'end': 8848.556, 'text': 'So if I grab this form, bring it back into my view, and or bring it into my new view, not back into it, we have to render out this form.', 'start': 8838.912, 'duration': 9.644}, {'end': 8851.817, 'text': 'So to render it out, we create an instance of the form.', 'start': 8849.156, 'duration': 2.661}, {'end': 8856.16, 'text': "So we'll say form is that this creates an instance of that form.", 'start': 8851.897, 'duration': 4.263}, {'end': 8862.883, 'text': 'as you may be familiar with Python and how you create instances from a class, we add that form into our context.', 'start': 8856.16, 'duration': 6.723}, {'end': 8869.847, 'text': 'Okay, so again, we could say my form here, and then have form there.', 'start': 8864.864, 'duration': 4.983}, {'end': 8872.476, 'text': 'still going off that product creates.', 'start': 8871.115, 'duration': 1.361}, {'end': 8879.961, 'text': "So back in that HTML, I'm gonna get rid of this here, and just do form dot as P.", 'start': 8872.596, 'duration': 7.365}, {'end': 8881.963, 'text': 'So this renders it out as paragraph text.', 'start': 8879.961, 'duration': 2.002}, {'end': 8887.267, 'text': "So if we save this and take a look there, let's just refresh that page.", 'start': 8881.983, 'duration': 5.284}, {'end': 8890.669, 'text': 'I can inspect the element and take a look and see that.', 'start': 8887.267, 'duration': 3.402}, {'end': 8892.09, 'text': "hey, we've got our form.", 'start': 8890.669, 'duration': 1.421}, {'end': 8892.951, 'text': "we've got an action.", 'start': 8892.09, 'duration': 0.861}, {'end': 8894.692, 'text': 'we have our CSRF middleware.', 'start': 8892.951, 'duration': 1.741}, {'end': 8898.515, 'text': 'token that security token, we have some P tags in here.', 'start': 8894.692, 'duration': 3.823}, {'end': 8908.585, 'text': "And that's as P, there's other ones like as HTML, or no, not as HTML, but as Li, or is it ul, something like that.", 'start': 8899.035, 'duration': 9.55}, {'end': 8909.906, 'text': 'There you go.', 'start': 8909.466, 'duration': 0.44}, {'end': 8913.148, 'text': 'So you can render it out as ul, it is HTML.', 'start': 8910.086, 'duration': 3.062}, {'end': 8914.67, 'text': "So as HTML doesn't make sense.", 'start': 8913.189, 'duration': 1.481}, {'end': 8917.092, 'text': 'But SP is a way to render it out.', 'start': 8915.69, 'duration': 1.402}, {'end': 8920.494, 'text': 'And now we have a form with some data.', 'start': 8917.832, 'duration': 2.662}, {'end': 8925.158, 'text': 'So I can add in whatever I like, right, and hit Save.', 'start': 8921.055, 'duration': 4.103}, {'end': 8935.654, 'text': 'Now, naturally, what just happened was, we submitted the data to our form here, or at least it seemed like we did.', 'start': 8926.348, 'duration': 9.306}, {'end': 8938.396, 'text': "But we didn't, we didn't do anything, right.", 'start': 8936.215, 'duration': 2.181}], 'summary': 'Discussing django form fields and rendering forms in a view.', 'duration': 138.096, 'max_score': 8800.3, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U48800300.jpg'}, {'end': 8925.158, 'src': 'embed', 'start': 8899.035, 'weight': 0, 'content': [{'end': 8908.585, 'text': "And that's as P, there's other ones like as HTML, or no, not as HTML, but as Li, or is it ul, something like that.", 'start': 8899.035, 'duration': 9.55}, {'end': 8909.906, 'text': 'There you go.', 'start': 8909.466, 'duration': 0.44}, {'end': 8913.148, 'text': 'So you can render it out as ul, it is HTML.', 'start': 8910.086, 'duration': 3.062}, {'end': 8914.67, 'text': "So as HTML doesn't make sense.", 'start': 8913.189, 'duration': 1.481}, {'end': 8917.092, 'text': 'But SP is a way to render it out.', 'start': 8915.69, 'duration': 1.402}, {'end': 8920.494, 'text': 'And now we have a form with some data.', 'start': 8917.832, 'duration': 2.662}, {'end': 8925.158, 'text': 'So I can add in whatever I like, right, and hit Save.', 'start': 8921.055, 'duration': 4.103}], 'summary': 'Discussion about rendering content as html or sp, and adding data to a form.', 'duration': 26.123, 'max_score': 8899.035, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U48899035.jpg'}, {'end': 9208.262, 'src': 'heatmap', 'start': 9072.843, 'weight': 0.74, 'content': [{'end': 9074.245, 'text': 'So again, I remove that.', 'start': 9072.843, 'duration': 1.402}, {'end': 9080.426, 'text': 'And then the final last one all those requirements.', 'start': 9077.165, 'duration': 3.261}, {'end': 9083.027, 'text': 'just remove it and I hit save Django.', 'start': 9080.426, 'duration': 2.601}, {'end': 9085.268, 'text': 'now does the validation for me right?', 'start': 9083.027, 'duration': 2.241}, {'end': 9093.172, 'text': 'So I actually showed you a way that a user could potentially disrupt some of your raw HTML forms.', 'start': 9085.308, 'duration': 7.864}, {'end': 9103.676, 'text': "And that's where Django security comes in, not just for this, but also for this, right? So I absolutely need all of those things working.", 'start': 9093.892, 'duration': 9.784}, {'end': 9106.037, 'text': 'So I had all of those fields required.', 'start': 9103.696, 'duration': 2.341}, {'end': 9108.339, 'text': 'this is a way to actually validate it.', 'start': 9106.777, 'duration': 1.562}, {'end': 9110.18, 'text': 'This does the validation.', 'start': 9108.739, 'duration': 1.441}, {'end': 9121.911, 'text': "So there's a method called if my form is valid, this will actually say, hey, you have a valid form, you know, now the data is good.", 'start': 9110.801, 'duration': 11.11}, {'end': 9125.474, 'text': "And I'll explain the data part in just a second.", 'start': 9121.931, 'duration': 3.543}, {'end': 9131.64, 'text': "But now that the data is good, we'll go ahead and print out my form dot cleaned data.", 'start': 9125.895, 'duration': 5.745}, {'end': 9137.716, 'text': "And So this would be the data that actually comes through from the form after it's been validated.", 'start': 9131.66, 'duration': 6.056}, {'end': 9143.781, 'text': 'Okay And then we can also say print else my form dot errors.', 'start': 9137.736, 'duration': 6.045}, {'end': 9147.458, 'text': "Okay, so we've got those two different methods.", 'start': 9145.117, 'duration': 2.341}, {'end': 9149.099, 'text': "So if it's valid, then it's going to do that.", 'start': 9147.498, 'duration': 1.601}, {'end': 9152.021, 'text': "If it's not valid, then it's going to print out what those errors are.", 'start': 9149.319, 'duration': 2.702}, {'end': 9157.484, 'text': "Oftentimes, you won't necessarily need this, because the form itself, as we've already seen,", 'start': 9152.621, 'duration': 4.863}, {'end': 9161.166, 'text': 'renders out the problems that might be related to that form.', 'start': 9157.484, 'duration': 3.682}, {'end': 9164.308, 'text': "And that's because of this right here, too.", 'start': 9161.707, 'duration': 2.601}, {'end': 9169.091, 'text': "So a lot of built in features going on here that we're just not quite breaking down just yet.", 'start': 9164.828, 'duration': 4.263}, {'end': 9171.431, 'text': "So let's go ahead and take a look at this.", 'start': 9169.691, 'duration': 1.74}, {'end': 9173.492, 'text': "Let's actually put in some valid data.", 'start': 9171.652, 'duration': 1.84}, {'end': 9177.493, 'text': "So we come back in this create method, I'll say ABC, you know, whatever.", 'start': 9173.972, 'duration': 3.521}, {'end': 9180.154, 'text': 'And whatever, I hit save.', 'start': 9178.513, 'duration': 1.641}, {'end': 9185.675, 'text': "And nothing that form doesn't rerender, which will solve that problem in a minute.", 'start': 9181.494, 'duration': 4.181}, {'end': 9191.696, 'text': "But if we look at our terminal, we see, hey, here's our clean data, it actually gives us that data.", 'start': 9186.095, 'duration': 5.601}, {'end': 9195.217, 'text': 'And that error list digit show up as well.', 'start': 9192.376, 'duration': 2.841}, {'end': 9198.938, 'text': 'Because we resubmitted the form, and there were some errors.', 'start': 9196.217, 'duration': 2.721}, {'end': 9200.677, 'text': 'And OK.', 'start': 9198.958, 'duration': 1.719}, {'end': 9206.241, 'text': 'so what is another thing that we could do that you know, would potentially cause some problems?', 'start': 9200.677, 'duration': 5.564}, {'end': 9208.262, 'text': 'what if I change this price field?', 'start': 9206.241, 'duration': 2.021}], 'summary': 'Demonstrating django form validation and handling of valid and invalid data.', 'duration': 135.419, 'max_score': 9072.843, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U49072843.jpg'}, {'end': 9362.473, 'src': 'embed', 'start': 9318.468, 'weight': 1, 'content': [{'end': 9321.17, 'text': 'Now there are parameters and things that we can set in here.', 'start': 9318.468, 'duration': 2.702}, {'end': 9326.213, 'text': "there's definitely a lot more that we can do with these fields, including rendering out how this description works.", 'start': 9321.17, 'duration': 5.043}, {'end': 9329.535, 'text': "So we're going to dive a little bit more into that in the next one.", 'start': 9326.633, 'duration': 2.902}, {'end': 9337.998, 'text': "Now what we're gonna do is things related to any individual field.", 'start': 9333.615, 'duration': 4.383}, {'end': 9345.783, 'text': "Like let's say for instance, you want a field to not be required or you wanna change the label of it or whatever input is in there by default.", 'start': 9338.658, 'duration': 7.125}, {'end': 9351.626, 'text': 'So if you take a look at your forms themselves, we can change a lot of things very simply.', 'start': 9346.063, 'duration': 5.563}, {'end': 9358.151, 'text': 'Do you want this field to be required? Well, just type out required true or false.', 'start': 9352.207, 'duration': 5.944}, {'end': 9362.473, 'text': 'Right Obviously, with the title, I want it to be required.', 'start': 9358.951, 'duration': 3.522}], 'summary': 'Exploring parameters and customization for fields in forms.', 'duration': 44.005, 'max_score': 9318.468, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U49318468.jpg'}], 'start': 8746.05, 'title': 'Django form creation and handling', 'summary': 'Covers creating django forms, including declaring form inputs, rendering the form in a view, and handling form submission and validation errors. it also explains form handling in django, including form initialization, validation, and field customization, with detailed examples.', 'chapters': [{'end': 8978.362, 'start': 8746.05, 'title': 'Creating django forms', 'summary': 'Explains the process of creating django forms, including declaring form inputs, rendering the form in a view, and handling form submission and validation errors.', 'duration': 232.312, 'highlights': ['The process of creating Django forms involves declaring inputs using standard Django form fields like char field and decimal field.', 'Rendering the form in a view involves creating an instance of the form and adding it to the context, then using form.as_p to render it out as paragraph text.', 'Handling form submission and validation errors is achieved by using request.post to retrieve the submitted data and addressing the validation errors that may occur.']}, {'end': 9389.86, 'start': 8978.382, 'title': 'Django form handling', 'summary': 'Explains how to handle forms in django, including form initialization, form validation, and form field customization, demonstrating the process of form handling and validation in detail with examples.', 'duration': 411.478, 'highlights': ['Django form handling includes form initialization, form validation, and form field customization.', 'Demonstration of handling form data through request methods, such as GET and POST.', 'Explanation of form validation using built-in methods and handling of form errors.', 'Illustration of form field customization, including setting field requirements and changing field labels.']}], 'duration': 643.81, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U48746050.jpg', 'highlights': ['Rendering the form in a view involves creating an instance of the form and adding it to the context, then using form.as_p to render it out as paragraph text.', 'The process of creating Django forms involves declaring inputs using standard Django form fields like char field and decimal field.', 'Django form handling includes form initialization, form validation, and form field customization.', 'Demonstration of handling form data through request methods, such as GET and POST.', 'Explanation of form validation using built-in methods and handling of form errors.']}, {'end': 10379.614, 'segs': [{'end': 9495.12, 'src': 'embed', 'start': 9466.967, 'weight': 1, 'content': [{'end': 9470.128, 'text': 'And you might end up changing things like a text area.', 'start': 9466.967, 'duration': 3.161}, {'end': 9476.531, 'text': 'And perhaps you want to have even bigger or larger changes to that that particular input.', 'start': 9470.689, 'duration': 5.842}, {'end': 9483.453, 'text': 'And we then just put in some parentheses here, attributes equals to another dictionary.', 'start': 9477.251, 'duration': 6.202}, {'end': 9491.037, 'text': "So since I'm really overriding a lot of this, I'm just going to go ahead and separate out some of this.", 'start': 9484.193, 'duration': 6.844}, {'end': 9495.12, 'text': "So I can more clearly understand what's going on here.", 'start': 9492.098, 'duration': 3.022}], 'summary': 'Discussing code changes and separating attributes for better understanding.', 'duration': 28.153, 'max_score': 9466.967, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U49466967.jpg'}, {'end': 9764.44, 'src': 'embed', 'start': 9729.709, 'weight': 3, 'content': [{'end': 9733.793, 'text': 'So now what hopefully you realized, and I did mention the last one.', 'start': 9729.709, 'duration': 4.084}, {'end': 9736.596, 'text': 'but now these forms are actually identical.', 'start': 9733.793, 'duration': 2.803}, {'end': 9738.738, 'text': 'they have the same three fields.', 'start': 9736.596, 'duration': 2.142}, {'end': 9741.54, 'text': "the only thing that's different is how the view handles them.", 'start': 9738.738, 'duration': 2.802}, {'end': 9742.201, 'text': "That's it.", 'start': 9741.801, 'duration': 0.4}, {'end': 9746.205, 'text': "But we're going to go back to using that product form itself.", 'start': 9742.701, 'duration': 3.504}, {'end': 9748.767, 'text': "So I'm going to go ahead and comment out all of this.", 'start': 9746.825, 'duration': 1.942}, {'end': 9754.933, 'text': "And we'll come back into our original product create view that we were using.", 'start': 9750.108, 'duration': 4.825}, {'end': 9764.44, 'text': 'Okay So what I have here is a shortcut method to what I did up here, right? So that request post, and then render these things out.', 'start': 9755.894, 'duration': 8.546}], 'summary': 'Forms are identical with same fields, only view handling differs.', 'duration': 34.731, 'max_score': 9729.709, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U49729709.jpg'}, {'end': 9883.988, 'src': 'embed', 'start': 9854.037, 'weight': 4, 'content': [{'end': 9856.238, 'text': 'So that word itself or those initials itself.', 'start': 9854.037, 'duration': 2.201}, {'end': 9864.992, 'text': 'what I need to do here is come in and say define clean underscore, then my field name.', 'start': 9857.219, 'duration': 7.773}, {'end': 9870.962, 'text': "So whatever field that I'm going to be grabbing the validation for, this is what I want to do.", 'start': 9865.633, 'duration': 5.329}, {'end': 9877.705, 'text': 'clean title, right? So I want to make sure my title has a specific item in there.', 'start': 9872.102, 'duration': 5.603}, {'end': 9883.988, 'text': "So he's just a self and we can do ours and keyword ours, those are probably not necessary.", 'start': 9878.345, 'duration': 5.643}], 'summary': "Defining validation rules for fields like 'clean_title' to ensure specific content.", 'duration': 29.951, 'max_score': 9854.037, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U49854037.jpg'}, {'end': 10200.348, 'src': 'embed', 'start': 10165.26, 'weight': 0, 'content': [{'end': 10169.744, 'text': 'So it of course, is outside of the form itself, because it might change based on your view.', 'start': 10165.26, 'duration': 4.484}, {'end': 10174.868, 'text': 'So this is my awesome title, something like that.', 'start': 10170.285, 'duration': 4.583}, {'end': 10177.527, 'text': 'And then we just pass it in to our form.', 'start': 10175.785, 'duration': 1.742}, {'end': 10179.67, 'text': 'So we just say initial equals to that data.', 'start': 10177.567, 'duration': 2.103}, {'end': 10182.694, 'text': 'And again, we can use any of the fields that are in there.', 'start': 10180.271, 'duration': 2.423}, {'end': 10189.422, 'text': "So if I refresh in there, what do you see, we've got that initial title in there, it's not a placeholder, it's literally the same text.", 'start': 10183.295, 'duration': 6.127}, {'end': 10191.585, 'text': "or it's the actual text that's in there.", 'start': 10190.185, 'duration': 1.4}, {'end': 10196.387, 'text': "Now, I don't know how often you're going to do this in a raw Django form.", 'start': 10192.266, 'duration': 4.121}, {'end': 10200.348, 'text': "more likely, what you'll do is do it in a product form or a model form itself.", 'start': 10196.387, 'duration': 3.961}], 'summary': 'Demonstrating passing initial data to a form in django.', 'duration': 35.088, 'max_score': 10165.26, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U410165260.jpg'}], 'start': 9390.6, 'title': 'Django form customization, validation, and model form data', 'summary': 'Covers customizing form fields such as changing labels, overriding default widgets, and adding validation to form fields using built-in django validation. it also discusses the implementation of form validation, defining clean methods, and validating form inputs. additionally, it explains setting initial data on a form, editing model form data, and making content dynamic based on the url.', 'chapters': [{'end': 9854.017, 'start': 9390.6, 'title': 'Django form customization', 'summary': 'Covers customizing form fields in django, such as changing labels and initial values, overriding default widgets, setting attributes like rows and columns for text areas, and adding validation to form fields using built-in django validation. it also highlights the identical nature of different forms and the importance of how the view handles them.', 'duration': 463.417, 'highlights': ['Changing labels, initial values, and overriding default widgets in Django form fields, demonstrating the customization of form fields, like price and description, to meet specific requirements.', 'Setting attributes like rows and columns for text areas, showcasing the ability to customize the size and appearance of the form input fields.', 'Adding validation to form fields using built-in Django validation, emphasizing the practical implementation of validation rules to ensure data integrity and accuracy.', "Highlighting the identical nature of different forms and the importance of how the view handles them, underscoring the significance of the view's role in handling form data."]}, {'end': 10011.149, 'start': 9854.037, 'title': 'Django form validation', 'summary': 'Discusses the implementation of form validation in django, including defining clean methods, triggering form cleaning, and validating form inputs using specific conditions and error handling.', 'duration': 157.112, 'highlights': ['The chapter discusses the implementation of form validation in Django.', 'Defining clean methods and triggering form cleaning.', 'Validating form inputs using specific conditions and error handling.']}, {'end': 10379.614, 'start': 10011.63, 'title': 'Django form validation and model form data', 'summary': 'Explains django form validation, introducing validation as a concept, setting initial data on a form, editing model form data, and making the content dynamic based on the url.', 'duration': 367.984, 'highlights': ['Django form validation is introduced as a concept, applicable to both model and standard Django forms.', 'Setting initial data on a form is demonstrated by creating a dictionary and passing it into the form, showing how the initial data is displayed in the form.', 'Editing model form data is shown by changing an object in the database using the form and ensuring the form is valid before saving the changes.', 'The process of making content dynamic based on the URL is elucidated, utilizing brackets and declaring the type of data to be passed in.']}], 'duration': 989.014, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U49390600.jpg', 'highlights': ['Changing labels, initial values, and overriding default widgets in Django form fields, demonstrating the customization of form fields, like price and description, to meet specific requirements.', 'Adding validation to form fields using built-in Django validation, emphasizing the practical implementation of validation rules to ensure data integrity and accuracy.', 'Defining clean methods and triggering form cleaning, ensuring the accuracy and integrity of form inputs.', 'Setting initial data on a form is demonstrated by creating a dictionary and passing it into the form, showing how the initial data is displayed in the form.', 'The process of making content dynamic based on the URL is elucidated, utilizing brackets and declaring the type of data to be passed in.']}, {'end': 11281.19, 'segs': [{'end': 10501.871, 'src': 'embed', 'start': 10450.27, 'weight': 2, 'content': [{'end': 10458.115, 'text': 'So again, if I actually change this to ID and refreshed in here, I get this problem, this dynamic lookup or our view.', 'start': 10450.27, 'duration': 7.845}, {'end': 10459.556, 'text': 'this is really just our view.', 'start': 10458.115, 'duration': 1.441}, {'end': 10460.597, 'text': 'function here.', 'start': 10459.556, 'duration': 1.041}, {'end': 10462.918, 'text': "doesn't know what this keyword argument is.", 'start': 10460.597, 'duration': 2.321}, {'end': 10465.46, 'text': 'So we just have to make sure that we put it in here.', 'start': 10463.358, 'duration': 2.102}, {'end': 10480.323, 'text': 'to handle a missing objects from a dynamic URL, we are going to import a new shortcut called get object or 404.', 'start': 10469.281, 'duration': 11.042}, {'end': 10484.284, 'text': "So basically, it's going to raise a 404 page if it's not used.", 'start': 10480.323, 'duration': 3.961}, {'end': 10492.406, 'text': "So all we need to do here is get object or 404, the actual model that we're using, and then the lookup parameters that we're using.", 'start': 10484.444, 'duration': 7.962}, {'end': 10495.527, 'text': 'And that will solve that error.', 'start': 10493.246, 'duration': 2.281}, {'end': 10496.647, 'text': 'So we save that.', 'start': 10496.047, 'duration': 0.6}, {'end': 10501.871, 'text': 'And now if I go in here on product does not exist, no longer will give me this sort of error.', 'start': 10497.068, 'duration': 4.803}], 'summary': 'Using get_object_or_404 to handle missing objects in dynamic urls, solving errors and avoiding 404 pages, enhancing user experience.', 'duration': 51.601, 'max_score': 10450.27, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U410450270.jpg'}, {'end': 11005.019, 'src': 'embed', 'start': 10956.018, 'weight': 8, 'content': [{'end': 10964.928, 'text': "And what I mean dynamic is in my urls.py, if I ever change this to let's say, those links would actually update, right.", 'start': 10956.018, 'duration': 8.91}, {'end': 10967.951, 'text': 'So if I click on that, it now actually updates it as well.', 'start': 10964.948, 'duration': 3.003}, {'end': 10973.676, 'text': 'And it does it across the entire site, everywhere where the get absolute URL method is used,', 'start': 10968.311, 'duration': 5.365}, {'end': 10976.618, 'text': 'which there are third party packages that use this as well.', 'start': 10973.676, 'duration': 2.942}, {'end': 10981.823, 'text': "So let's just keep that in mind when it comes to making this more dynamic.", 'start': 10977.459, 'duration': 4.364}, {'end': 10986.186, 'text': 'Sure, you can hard code it, but that is definitely not a recommended method.', 'start': 10982.283, 'duration': 3.903}, {'end': 10988.969, 'text': "So let's leave it as products slash.", 'start': 10986.747, 'duration': 2.222}, {'end': 11001.578, 'text': "If you take everything we've done so far and just clean it up into their own views with names that match to your app, you'll see something like this", 'start': 10993.575, 'duration': 8.003}, {'end': 11005.019, 'text': 'The create view, the update view, I changed this.', 'start': 11001.958, 'duration': 3.061}], 'summary': 'Using dynamic urls allows for easy updating and is recommended over hard coding, especially when third party packages are involved.', 'duration': 49.001, 'max_score': 10956.018, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U410956018.jpg'}, {'end': 11110.453, 'src': 'embed', 'start': 11077.649, 'weight': 0, 'content': [{'end': 11078.99, 'text': "And it's importing path.", 'start': 11077.649, 'duration': 1.341}, {'end': 11081.151, 'text': 'And then we just declare URL patterns.', 'start': 11079.05, 'duration': 2.101}, {'end': 11089.297, 'text': 'Back in our main configuration URLs, I can go ahead and cut all of this out and paste it into my URL patterns now.', 'start': 11081.872, 'duration': 7.425}, {'end': 11093.94, 'text': 'Okay, so these are now those apps URL patterns.', 'start': 11089.317, 'duration': 4.623}, {'end': 11098.869, 'text': 'So back in my URLs, I actually have a way to use those URLs.', 'start': 11094.608, 'duration': 4.261}, {'end': 11101.63, 'text': "It's right here in the comments, it's already in there.", 'start': 11099.47, 'duration': 2.16}, {'end': 11110.453, 'text': 'So all we have to do is import include, and then bring in the example that it gives what is for a blog app.', 'start': 11101.69, 'duration': 8.763}], 'summary': 'Importing and using url patterns for a blog app in the main configuration', 'duration': 32.804, 'max_score': 11077.649, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U411077649.jpg'}, {'end': 11204.337, 'src': 'embed', 'start': 11174.454, 'weight': 1, 'content': [{'end': 11179.016, 'text': 'Now what I can do in my model is just add that in here to products colon.', 'start': 11174.454, 'duration': 4.562}, {'end': 11185.799, 'text': 'And now my reverse is based off of the app itself or the namespace and the URL name.', 'start': 11179.576, 'duration': 6.223}, {'end': 11187.499, 'text': 'So we save that refresh.', 'start': 11186.199, 'duration': 1.3}, {'end': 11190.381, 'text': "And now it's actually going to take us where it should.", 'start': 11187.96, 'duration': 2.421}, {'end': 11192.483, 'text': 'This is a common problem.', 'start': 11191.181, 'duration': 1.302}, {'end': 11197.088, 'text': 'So if you have to test this out and try it out on your own, please go ahead and do that.', 'start': 11192.523, 'duration': 4.565}, {'end': 11204.337, 'text': "And do realize that having names on the URLs doesn't mean that it's going to check to make sure that those things are unique.", 'start': 11197.669, 'duration': 6.668}], 'summary': 'Model update resolves url navigation issues, testing recommended.', 'duration': 29.883, 'max_score': 11174.454, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U411174454.jpg'}], 'start': 10380.155, 'title': 'Dynamic url handling and namespace in django', 'summary': 'Covers dynamic url handling, namespace, and reusability in django, showcasing methods to create clean and maintainable urls, optimize object deletion, and handle dynamic urls, resulting in improved error reduction, reusability, and scalability.', 'chapters': [{'end': 10572.64, 'start': 10380.155, 'title': 'Dynamic url handling in django', 'summary': 'Demonstrates how to handle dynamic urls in django, passing arguments to views, utilizing get_object_or_404 and handling exceptions, resulting in error reduction and improved user experience.', 'duration': 192.485, 'highlights': ["The view passes a new argument, such as ID, to the view function, which dynamically changes the object based on the ID passed, improving the URL's dynamic behavior and database lookup.", 'The use of get_object_or_404 function ensures that a 404 page is raised if the object is not found, resulting in improved error handling and user experience.', "Implementing a try block to handle exceptions, such as the model name not existing, provides an alternative approach to error handling when retrieving objects, further enhancing the application's robustness."]}, {'end': 10933.33, 'start': 10573.28, 'title': 'Django: confirm delete and rendering objects', 'summary': 'Explains how to optimize the process of deleting objects by confirming with a post request, rendering a list of objects using query sets, and creating a dynamic url method, enhancing reusability in django.', 'duration': 360.05, 'highlights': ['Rendering a list of objects using query sets and context variable object list', 'Creating a dynamic URL method with get absolute URL for reusability', 'Optimizing the process of deleting objects by confirming with a post request']}, {'end': 11281.19, 'start': 10933.55, 'title': 'Dynamic url handling and namespace in django', 'summary': 'Discusses the importance of dynamic urls, namespace, and reusability of apps in django, highlighting the process of creating clean and easy-to-maintain urls, avoiding potential issues with duplicate names, and emphasizing the significance of reverse method and namespace for scalability and reusability.', 'duration': 347.64, 'highlights': ['The chapter discusses the importance of dynamic URLs, namespace, and reusability of apps in Django.', 'The process of creating clean and easy-to-maintain URLs is demonstrated.', 'Avoiding potential issues with duplicate names and keyword arguments is highlighted.', 'Emphasizing the significance of reverse method and namespace for scalability and reusability is discussed.']}], 'duration': 901.035, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U410380155.jpg', 'highlights': ["The view passes a new argument, such as ID, to the view function, improving the URL's dynamic behavior and database lookup.", 'The use of get_object_or_404 function ensures that a 404 page is raised if the object is not found, improving error handling and user experience.', "Implementing a try block to handle exceptions provides an alternative approach to error handling when retrieving objects, enhancing the application's robustness.", 'Creating a dynamic URL method with get absolute URL for reusability.', 'Optimizing the process of deleting objects by confirming with a post request.', 'The chapter discusses the importance of dynamic URLs, namespace, and reusability of apps in Django.', 'The process of creating clean and easy-to-maintain URLs is demonstrated.', 'Emphasizing the significance of reverse method and namespace for scalability and reusability is discussed.', 'Avoiding potential issues with duplicate names and keyword arguments is highlighted.', 'Rendering a list of objects using query sets and context variable object list.']}, {'end': 12237.164, 'segs': [{'end': 11696.412, 'src': 'embed', 'start': 11668.287, 'weight': 2, 'content': [{'end': 11673.751, 'text': 'the primary function of a detailed view is to render a template from a specific object.', 'start': 11668.287, 'duration': 5.464}, {'end': 11680.917, 'text': "Now if I got rid of this query set here, and refreshed, it would still work, actually don't need that query set.", 'start': 11674.531, 'duration': 6.386}, {'end': 11685.782, 'text': 'What the query set does is it limits the choices available for that detail view.', 'start': 11681.658, 'duration': 4.124}, {'end': 11688.244, 'text': "In other words, let's take a look at that.", 'start': 11686.363, 'duration': 1.881}, {'end': 11696.412, 'text': "If I change this to being like, filter ID is greater than one, don't worry if you don't understand what that is.", 'start': 11689.205, 'duration': 7.207}], 'summary': 'The primary function of a detailed view is to render a template from a specific object, and the query set limits the choices available for that detail view.', 'duration': 28.125, 'max_score': 11668.287, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U411668287.jpg'}, {'end': 12006.821, 'src': 'embed', 'start': 11982.264, 'weight': 6, 'content': [{'end': 11994.152, 'text': 'But the main thing here is I can also change where I want that to go by just overriding the success URL like this, or define get success URL.', 'start': 11982.264, 'duration': 11.888}, {'end': 11997.454, 'text': 'And you can return some path.', 'start': 11995.913, 'duration': 1.541}, {'end': 12000.196, 'text': 'That is another way to override that.', 'start': 11998.255, 'duration': 1.941}, {'end': 12006.821, 'text': "But but the default method works really well for us because chances are good after you create an article, you're probably going to want to look at it.", 'start': 12000.256, 'duration': 6.565}], 'summary': 'Demonstrates how to override success url for better user experience.', 'duration': 24.557, 'max_score': 11982.264, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U411982264.jpg'}, {'end': 12128.583, 'src': 'embed', 'start': 12069.947, 'weight': 1, 'content': [{'end': 12073.207, 'text': 'So the create and update are almost identical.', 'start': 12069.947, 'duration': 3.26}, {'end': 12081.47, 'text': "The only difference is it actually grabs an object or an instance of the thing it's trying to change, still using the same form,", 'start': 12073.388, 'duration': 8.082}, {'end': 12082.69, 'text': 'still using the same query set.', 'start': 12081.47, 'duration': 1.22}, {'end': 12089.848, 'text': 'When we want to remove an object, we just use the delete view.', 'start': 12086.647, 'duration': 3.201}, {'end': 12093.109, 'text': "And it's very similar to the detail view.", 'start': 12090.568, 'duration': 2.541}, {'end': 12097.73, 'text': 'So article, delete view, and delete view.', 'start': 12093.229, 'duration': 4.501}, {'end': 12100.871, 'text': "And then we're going to use a different template called delete.", 'start': 12098.71, 'duration': 2.161}, {'end': 12104.171, 'text': 'And then again, we still want that get object method here.', 'start': 12101.811, 'duration': 2.36}, {'end': 12114.174, 'text': 'And my actual delete form is identical to the one that we created in product with the exception that I called it product here and post here.', 'start': 12104.872, 'duration': 9.302}, {'end': 12119.958, 'text': 'So we save that we save our views here, do some imports.', 'start': 12115.495, 'duration': 4.463}, {'end': 12126.882, 'text': 'And bring in a view name as view on comment this out.', 'start': 12121.919, 'duration': 4.963}, {'end': 12128.583, 'text': 'Same stuff.', 'start': 12128.043, 'duration': 0.54}], 'summary': "Creating, updating, and deleting views are similar with minor differences. utilize the same form and query set. utilize 'delete view' for removing an object.", 'duration': 58.636, 'max_score': 12069.947, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U412069947.jpg'}, {'end': 12237.164, 'src': 'embed', 'start': 12153.945, 'weight': 0, 'content': [{'end': 12162.511, 'text': 'So what we need to do is set one and, instead of setting the actual string so like success URL to something like blog,', 'start': 12153.945, 'duration': 8.566}, {'end': 12166.774, 'text': "what I'm going to do instead is I'm going to bring in my reverse call.", 'start': 12162.511, 'duration': 4.263}, {'end': 12170.616, 'text': 'So from Django dot URLs, import reverse.', 'start': 12166.854, 'duration': 3.762}, {'end': 12173.959, 'text': "Actually, let's put that right under here.", 'start': 12172.378, 'duration': 1.581}, {'end': 12186.18, 'text': "And then I'll just go ahead and say define, get success, URL takes itself And it's going to return reverse blog list view,", 'start': 12175.44, 'duration': 10.74}, {'end': 12189.783, 'text': 'or you know whatever we have here, which is actually article list.', 'start': 12186.18, 'duration': 3.603}, {'end': 12190.464, 'text': 'good thing, I looked.', 'start': 12189.783, 'duration': 0.681}, {'end': 12192.546, 'text': 'So we change it to article list.', 'start': 12191.365, 'duration': 1.181}, {'end': 12194.987, 'text': 'And this is also articles.', 'start': 12193.406, 'duration': 1.581}, {'end': 12197.71, 'text': 'Okay Right there.', 'start': 12195.007, 'duration': 2.703}, {'end': 12200.472, 'text': 'Cool So now this is our new delete view.', 'start': 12198.49, 'duration': 1.982}, {'end': 12202.854, 'text': "I can't leave that query set.", 'start': 12200.492, 'duration': 2.362}, {'end': 12207.437, 'text': "But again, it doesn't matter just like the detail view, because of my get object call there.", 'start': 12202.894, 'duration': 4.543}, {'end': 12208.939, 'text': 'And I saved that.', 'start': 12208.298, 'duration': 0.641}, {'end': 12210.26, 'text': 'And now I go to delete.', 'start': 12209.239, 'duration': 1.021}, {'end': 12216.257, 'text': 'Do I want to delete it? We say yes, it deletes it, it brings me back to all my posts.', 'start': 12211.715, 'duration': 4.542}, {'end': 12217.837, 'text': 'Very simple.', 'start': 12217.237, 'duration': 0.6}, {'end': 12222.139, 'text': 'And something to note is that error, the delete error.', 'start': 12218.197, 'duration': 3.942}, {'end': 12231.362, 'text': "If I don't have that, get absolute URL method, or rather get success URL method, and I try to delete something and say yes,", 'start': 12223.359, 'duration': 8.003}, {'end': 12234.763, 'text': 'that error actually prevents that deletion, unlike the creation.', 'start': 12231.362, 'duration': 3.401}, {'end': 12237.164, 'text': 'Just something interesting to know.', 'start': 12235.783, 'duration': 1.381}], 'summary': 'Modified success url to reverse call, enabling simple deletion and avoiding errors.', 'duration': 83.219, 'max_score': 12153.945, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U412153945.jpg'}], 'start': 11282.253, 'title': 'Django views and forms', 'summary': 'Covers creating class-based views like list view and detail view, overriding keyword arguments, creating model form views, and exploring django model methods and views, which improves efficiency and enables easy navigation and modification of database objects.', 'chapters': [{'end': 11481.519, 'start': 11282.253, 'title': 'Creating class based views', 'summary': 'Discusses creating the simplest class-based views, like list view and detail view, which eliminate the need for rendering, template naming, and other complexities, making the process more efficient and concise.', 'duration': 199.266, 'highlights': ["Creating a list view by defining a class 'article list view' and inheriting from the list view, which eliminates the need for rendering and template naming, making the process simpler and more efficient.", 'Implementing a detail view by modifying the article list view, demonstrating the ease of creating different views with minimal changes.', 'Showing how to override default templates for views by specifying custom template names, providing flexibility in template usage.']}, {'end': 11732.233, 'start': 11482.3, 'title': 'Overriding keyword arguments in class based views', 'summary': "Explains how to override keyword arguments in class-based views, such as changing the url to use 'pk' instead of 'id', and clarifies the difference between detail views and list views, emphasizing the importance of the query set in the context of detailed views.", 'duration': 249.933, 'highlights': ['The primary function of a detailed view is to render a template from a specific object, and understanding the intricacies of class-based views is crucial for effective overriding and customization.', 'Explains the difference between detail views and list views, emphasizing the importance of the query set in the context of detailed views.', 'Clarifies the difference between detail views and list views, emphasizing the importance of the query set in the context of detailed views.', 'Emphasizes the importance of the query set in the context of detailed views and its role in limiting the choices available for the view, with a practical example of filtering by ID.']}, {'end': 11896.478, 'start': 11732.233, 'title': 'Creating model form views', 'summary': 'Explains creating a model form view for creating or updating data, including importing the model form, defining the view, setting up the template, addressing issues related to using model form, and handling form validation and data saving.', 'duration': 164.245, 'highlights': ['The view creates a form for creating or updating data and is similar to other views in the system.', 'Importing the model form is essential for creating the view.', 'The view handles form validation and saves the data based on the defined model form validations.', 'Addressing the issue of using model form without the fields is important to ensure proper functionality.', 'The method form_valid() is used to handle valid form data and can be customized to display or process the cleaned data.']}, {'end': 12237.164, 'start': 11896.638, 'title': 'Django model methods and views', 'summary': 'Explores the creation of get absolute url method, override of success url, and use of delete view in django models and views, enabling easy navigation and modification of database objects.', 'duration': 340.526, 'highlights': ['The get absolute URL method is crucial for enabling the navigation to the created URL for a specific object, demonstrated in the creation and update views.', 'Overriding the success URL or defining the get success URL method provides the flexibility to specify the redirection path after object creation or modification, enhancing user experience.', 'The delete view, with the use of get object method, facilitates the removal of objects from the database, with the ability to customize the success URL using reverse call, ensuring smooth deletion process.']}], 'duration': 954.911, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U411282253.jpg', 'highlights': ['Creating a list view simplifies rendering and template naming, improving efficiency', 'Implementing a detail view demonstrates creating different views with minimal changes', 'Overriding default templates for views provides flexibility in template usage', 'Understanding class-based views is crucial for effective overriding and customization', 'Explaining the difference between detail views and list views is important for query set usage', 'Importing the model form is essential for creating the view', 'The view handles form validation and saves the data based on the defined model form validations', 'The get absolute URL method is crucial for enabling navigation to the created URL', 'Overriding the success URL provides flexibility in specifying the redirection path', 'The delete view facilitates the removal of objects from the database, ensuring smooth deletion process']}, {'end': 13528.285, 'segs': [{'end': 12320.834, 'src': 'embed', 'start': 12291.17, 'weight': 0, 'content': [{'end': 12293.532, 'text': "And again, we're going to pass in that view there.", 'start': 12291.17, 'duration': 2.362}, {'end': 12299.457, 'text': 'So to have the exact same function work, I can bring it right over.', 'start': 12294.553, 'duration': 4.904}, {'end': 12303.18, 'text': "So that function based view, I'm now turning it over here.", 'start': 12300.057, 'duration': 3.123}, {'end': 12308.103, 'text': "But if you remember, our actual name for our function-based views don't really matter.", 'start': 12303.88, 'duration': 4.223}, {'end': 12310.746, 'text': 'But inside of a class-based view, they do matter.', 'start': 12308.764, 'duration': 1.982}, {'end': 12315.089, 'text': "And they're correlated to the HTTP method that it's trying to handle.", 'start': 12311.046, 'duration': 4.043}, {'end': 12320.834, 'text': 'In other words, Git is the default, so Git will run here.', 'start': 12315.609, 'duration': 5.225}], 'summary': 'Transcript discusses passing views, function-based vs class-based views, and correlation to http methods.', 'duration': 29.664, 'max_score': 12291.17, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U412291170.jpg'}, {'end': 12445.842, 'src': 'embed', 'start': 12412.137, 'weight': 5, 'content': [{'end': 12412.979, 'text': 'So this is pretty cool.', 'start': 12412.137, 'duration': 0.842}, {'end': 12421.125, 'text': 'The other aspect of this is literally coming in here and changing this template name to contact.html.', 'start': 12414.301, 'duration': 6.824}, {'end': 12426.748, 'text': 'Save that refresh in here, what do you know, my template has actually changed.', 'start': 12421.805, 'duration': 4.943}, {'end': 12428.009, 'text': "So that's.", 'start': 12427.429, 'duration': 0.58}, {'end': 12434.573, 'text': 'one of the huge advantages of using class based views is how easy it is to change things.', 'start': 12428.009, 'duration': 6.564}, {'end': 12445.842, 'text': "So we now have this model in here and I'm gonna bring it into my view to have, this being a detail view.", 'start': 12438.854, 'duration': 6.988}], 'summary': 'Class based views make it easy to change template and model, offering advantages.', 'duration': 33.705, 'max_score': 12412.137, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U412412137.jpg'}, {'end': 12507.5, 'src': 'embed', 'start': 12466.675, 'weight': 3, 'content': [{'end': 12470.058, 'text': "So to do this, I'm going to pass an ID equals to none.", 'start': 12466.675, 'duration': 3.383}, {'end': 12474.847, 'text': 'ID equals to none means that the ID is no longer required.', 'start': 12471.084, 'duration': 3.763}, {'end': 12479.951, 'text': 'When you do it with just ID, that means that argument is required.', 'start': 12475.467, 'duration': 4.484}, {'end': 12485.074, 'text': "Saying that it's done means that we have a default here, you could also set another default if you like.", 'start': 12480.551, 'duration': 4.523}, {'end': 12492.44, 'text': 'But basically, that means that these two template or these two class based views will actually render just fine.', 'start': 12485.555, 'duration': 6.885}, {'end': 12494.775, 'text': "Now, let's actually take a look at this.", 'start': 12493.294, 'duration': 1.481}, {'end': 12504.599, 'text': "And what I'm going to do with my standard template is I'm going to do courses slash detail, or rather course detail, to you know.", 'start': 12495.035, 'duration': 9.564}, {'end': 12507.5, 'text': 'go along with the detail view, generic view.', 'start': 12504.599, 'duration': 2.901}], 'summary': "Passing id equals to none means it's no longer required, allowing for fine rendering of class based views.", 'duration': 40.825, 'max_score': 12466.675, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U412466675.jpg'}, {'end': 12843.865, 'src': 'embed', 'start': 12815.64, 'weight': 1, 'content': [{'end': 12818.542, 'text': 'When you create something, you want to accept two methods.', 'start': 12815.64, 'duration': 2.902}, {'end': 12821.004, 'text': "That's the get method and the post method.", 'start': 12818.602, 'duration': 2.402}, {'end': 12828.029, 'text': "So I'm going to go ahead and grab the course view here, paste it over and call it course, create view.", 'start': 12821.624, 'duration': 6.405}, {'end': 12830.25, 'text': 'And we have our get method in here.', 'start': 12828.689, 'duration': 1.561}, {'end': 12832.772, 'text': "I'm going to leave it in as empty context.", 'start': 12830.27, 'duration': 2.502}, {'end': 12839.137, 'text': 'And then we want to have our post method because when you actually create something, you post it to the backend.', 'start': 12833.233, 'duration': 5.904}, {'end': 12841.178, 'text': 'So we want to make sure that we have post.', 'start': 12839.657, 'duration': 1.521}, {'end': 12843.865, 'text': 'really simple.', 'start': 12843.305, 'duration': 0.56}], 'summary': 'Creating a course view with get and post methods.', 'duration': 28.225, 'max_score': 12815.64, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U412815640.jpg'}, {'end': 13008.628, 'src': 'embed', 'start': 12974.9, 'weight': 8, 'content': [{'end': 12981.725, 'text': 'So in a form, we can actually have validation with clean underscore whatever the field name is.', 'start': 12974.9, 'duration': 6.825}, {'end': 12989.372, 'text': "So the field name I'm validating is title, but it could be any of the model fields or any other form field that you might use.", 'start': 12982.066, 'duration': 7.306}, {'end': 12991.413, 'text': 'in case you forgot about that.', 'start': 12990.052, 'duration': 1.361}, {'end': 12995.136, 'text': "So we're going to go ahead and come in here and actually do it.", 'start': 12991.674, 'duration': 3.462}, {'end': 13008.628, 'text': "So title is equal to self cleaned data dot get and then the field name, of course, and we'll say if title dot lower is equal to something like ABC,", 'start': 12995.697, 'duration': 12.931}], 'summary': 'Validation for model fields and form fields using clean underscore method.', 'duration': 33.728, 'max_score': 12974.9, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U412974900.jpg'}, {'end': 13272.189, 'src': 'heatmap', 'start': 12995.697, 'weight': 0.865, 'content': [{'end': 13008.628, 'text': "So title is equal to self cleaned data dot get and then the field name, of course, and we'll say if title dot lower is equal to something like ABC,", 'start': 12995.697, 'duration': 12.931}, {'end': 13013.892, 'text': "then we'll just go ahead and raise forms dot validation error.", 'start': 13008.628, 'duration': 5.264}, {'end': 13018.056, 'text': 'And this is not a valid title.', 'start': 13015.053, 'duration': 3.003}, {'end': 13022.002, 'text': "Okay, so this is only on the form level, right? It doesn't do it on the model.", 'start': 13019.079, 'duration': 2.923}, {'end': 13023.825, 'text': 'It only does it on the form.', 'start': 13022.703, 'duration': 1.122}, {'end': 13027.809, 'text': "That's a key distinction here that you should remember.", 'start': 13024.505, 'duration': 3.304}, {'end': 13030.973, 'text': "Obviously, we're not going to touch it just yet, but that's a key distinction.", 'start': 13028.15, 'duration': 2.823}, {'end': 13033.936, 'text': "So now that we've got that, I didn't change anything in my view.", 'start': 13031.473, 'duration': 2.463}, {'end': 13036.099, 'text': "Let's go ahead and try it out.", 'start': 13034.417, 'duration': 1.682}, {'end': 13038.541, 'text': 'Coming back in here, I just type out ABC.', 'start': 13036.419, 'duration': 2.122}, {'end': 13042.068, 'text': 'hit save, I see that it says this is not a valid title.', 'start': 13039.386, 'duration': 2.682}, {'end': 13049.956, 'text': "So in other words, what our post method is doing is it's actually coming through and initializing what needs to happen.", 'start': 13042.769, 'duration': 7.187}, {'end': 13053.419, 'text': 'Now, there is one other thing that you might consider doing.', 'start': 13050.516, 'duration': 2.903}, {'end': 13057.422, 'text': "And that is once it's valid, you might actually want to rerender the form.", 'start': 13053.639, 'duration': 3.783}, {'end': 13062.648, 'text': "So let's say another title, I hit save, it stays in there.", 'start': 13057.823, 'duration': 4.825}, {'end': 13069.792, 'text': "Although I might wanna create another form or another course or whatever it is that I'm building, right? So I want it to be empty.", 'start': 13063.029, 'duration': 6.763}, {'end': 13072.493, 'text': 'I want it to be in its original state.', 'start': 13070.112, 'duration': 2.381}, {'end': 13077.376, 'text': 'So to do that, all I need to do is reinitialize the actual form itself.', 'start': 13073.094, 'duration': 4.282}, {'end': 13086.037, 'text': 'Your update view combines the things that we just did create and also detail.', 'start': 13081.476, 'duration': 4.561}, {'end': 13091.479, 'text': "So we've got this update view here, and we have two methods that are going to be there for sure.", 'start': 13086.598, 'duration': 4.881}, {'end': 13093.099, 'text': "And they're the same.", 'start': 13092.279, 'duration': 0.82}, {'end': 13095.82, 'text': "Basically, all they're doing right now is rendering out the form.", 'start': 13093.74, 'duration': 2.08}, {'end': 13099.141, 'text': "So it's really not a whole lot different than the create view as it currently stands.", 'start': 13095.84, 'duration': 3.301}, {'end': 13103.243, 'text': 'But the thing that I want to actually adjust is this get object method.', 'start': 13099.681, 'duration': 3.562}, {'end': 13111.025, 'text': 'So this method itself is going to override what you would typically do for your detail view.', 'start': 13103.703, 'duration': 7.322}, {'end': 13113.727, 'text': 'And you would have a method in there called get object.', 'start': 13111.045, 'duration': 2.682}, {'end': 13116.63, 'text': 'So then you can use it in your various methods.', 'start': 13113.807, 'duration': 2.823}, {'end': 13117.811, 'text': 'Otherwise, right.', 'start': 13117.23, 'duration': 0.581}, {'end': 13121.434, 'text': "So like, as we've done here, that is actually how we're going to call that object.", 'start': 13117.831, 'duration': 3.603}, {'end': 13128.02, 'text': "So what I want to do, then, is just pretty much grab the same data that I've done before,", 'start': 13121.955, 'duration': 6.065}, {'end': 13130.442, 'text': 'which is this right here this get object or 404 related stuff.', 'start': 13128.02, 'duration': 2.422}, {'end': 13133.305, 'text': 'right here, right.', 'start': 13132.324, 'duration': 0.981}, {'end': 13135.607, 'text': 'So this is going to grab that detail.', 'start': 13133.625, 'duration': 1.982}, {'end': 13141.212, 'text': 'And to grab the ID, we just do self dot, keyword args dot, get ID.', 'start': 13136.347, 'duration': 4.865}, {'end': 13146.536, 'text': 'those are obviously the keyword arguments that are coming through on our URL, like we see here.', 'start': 13141.212, 'duration': 5.324}, {'end': 13151.1, 'text': 'And ours right now is an integer with the name of ID.', 'start': 13146.876, 'duration': 4.224}, {'end': 13153.562, 'text': 'And this will actually grab that object for us.', 'start': 13151.64, 'duration': 1.922}, {'end': 13157.305, 'text': "So I'm just going to go ahead and say obj equals to none.", 'start': 13154.583, 'duration': 2.722}, {'end': 13160.099, 'text': 'And And this will grab that object.', 'start': 13157.786, 'duration': 2.313}, {'end': 13162.908, 'text': 'So now we have some object inside of our context.', 'start': 13160.119, 'duration': 2.789}, {'end': 13168.453, 'text': 'So this will work on both our get method as well as our post method, it will have that object in there.', 'start': 13163.709, 'duration': 4.744}, {'end': 13173.677, 'text': "And if we look at our template, it's a combination of that detail view and that create view form.", 'start': 13168.913, 'duration': 4.764}, {'end': 13179.441, 'text': "And now what we'll do then is actually update this item.", 'start': 13174.838, 'duration': 4.603}, {'end': 13185.326, 'text': 'So we have this item here, all I need to do is pass it in to my form as instance.', 'start': 13179.662, 'duration': 5.664}, {'end': 13187.268, 'text': 'So instance being OBJ.', 'start': 13185.706, 'duration': 1.562}, {'end': 13192.652, 'text': 'And I want to have that also down here in addition to the request that post.', 'start': 13187.748, 'duration': 4.904}, {'end': 13198.051, 'text': 'So this is grabbing that post data along with that instance.', 'start': 13194.81, 'duration': 3.241}, {'end': 13201.311, 'text': "this is initializing that, looking to see if it's valid.", 'start': 13198.051, 'duration': 3.26}, {'end': 13203.932, 'text': 'And if it is, then it will save everything for me.', 'start': 13201.591, 'duration': 2.341}, {'end': 13206.992, 'text': 'And then finally, my template has the method of post.', 'start': 13204.452, 'duration': 2.54}, {'end': 13209.953, 'text': "And the form really hasn't changed.", 'start': 13207.773, 'duration': 2.18}, {'end': 13211.133, 'text': "So let's go back in here.", 'start': 13210.153, 'duration': 0.98}, {'end': 13212.553, 'text': "And let's take a look.", 'start': 13211.773, 'duration': 0.78}, {'end': 13216.694, 'text': "I've got my update view here that we got a context error.", 'start': 13212.994, 'duration': 3.7}, {'end': 13220.355, 'text': 'So we want to make sure that we have context defined.', 'start': 13217.934, 'duration': 2.421}, {'end': 13224.449, 'text': "And that's this right here, that should actually not be there.", 'start': 13220.375, 'duration': 4.074}, {'end': 13226.15, 'text': 'Little mistake.', 'start': 13225.669, 'duration': 0.481}, {'end': 13226.63, 'text': 'Sorry about that.', 'start': 13226.17, 'duration': 0.46}, {'end': 13229.371, 'text': 'Okay, so we come back in here a hello world.', 'start': 13227.03, 'duration': 2.341}, {'end': 13231.052, 'text': "I'll just change it to being Hello.", 'start': 13229.371, 'duration': 1.681}, {'end': 13233.634, 'text': "I'll hit, save it changes it to Hello.", 'start': 13231.052, 'duration': 2.582}, {'end': 13235.255, 'text': 'I go back to the detail view.', 'start': 13233.634, 'duration': 1.621}, {'end': 13235.995, 'text': "it's still Hello.", 'start': 13235.255, 'duration': 0.74}, {'end': 13242.159, 'text': 'If I go back to the update view and change it to ABC and hit save, it does that validation again.', 'start': 13236.556, 'duration': 5.603}, {'end': 13251.082, 'text': "And Now you can probably see that this is redundant code, and it is, and that's because of how we had to do it by raw detail.", 'start': 13242.179, 'duration': 8.903}, {'end': 13254.263, 'text': "we started doing stuff that's not redundant code.", 'start': 13251.082, 'duration': 3.181}, {'end': 13259.845, 'text': "But really at this point it's like you might as well use that generic class based view,", 'start': 13254.864, 'duration': 4.981}, {'end': 13263.526, 'text': "the built in class based views that we've already gone over right.", 'start': 13259.845, 'duration': 3.681}, {'end': 13266.427, 'text': 'So I mean, this is just so much cleaner and simple.', 'start': 13263.586, 'duration': 2.841}, {'end': 13269.988, 'text': 'But the idea here is really understood.', 'start': 13266.867, 'duration': 3.121}, {'end': 13272.189, 'text': 'This is the raw version of it.', 'start': 13270.028, 'duration': 2.161}], 'summary': 'Demonstrating form validation and view update in a django project.', 'duration': 276.492, 'max_score': 12995.697, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U412995697.jpg'}, {'end': 13113.727, 'src': 'embed', 'start': 13086.598, 'weight': 9, 'content': [{'end': 13091.479, 'text': "So we've got this update view here, and we have two methods that are going to be there for sure.", 'start': 13086.598, 'duration': 4.881}, {'end': 13093.099, 'text': "And they're the same.", 'start': 13092.279, 'duration': 0.82}, {'end': 13095.82, 'text': "Basically, all they're doing right now is rendering out the form.", 'start': 13093.74, 'duration': 2.08}, {'end': 13099.141, 'text': "So it's really not a whole lot different than the create view as it currently stands.", 'start': 13095.84, 'duration': 3.301}, {'end': 13103.243, 'text': 'But the thing that I want to actually adjust is this get object method.', 'start': 13099.681, 'duration': 3.562}, {'end': 13111.025, 'text': 'So this method itself is going to override what you would typically do for your detail view.', 'start': 13103.703, 'duration': 7.322}, {'end': 13113.727, 'text': 'And you would have a method in there called get object.', 'start': 13111.045, 'duration': 2.682}], 'summary': 'The update view has two methods, one of which needs adjustment for the detail view.', 'duration': 27.129, 'max_score': 13086.598, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U413086598.jpg'}, {'end': 13266.427, 'src': 'embed', 'start': 13242.179, 'weight': 2, 'content': [{'end': 13251.082, 'text': "And Now you can probably see that this is redundant code, and it is, and that's because of how we had to do it by raw detail.", 'start': 13242.179, 'duration': 8.903}, {'end': 13254.263, 'text': "we started doing stuff that's not redundant code.", 'start': 13251.082, 'duration': 3.181}, {'end': 13259.845, 'text': "But really at this point it's like you might as well use that generic class based view,", 'start': 13254.864, 'duration': 4.981}, {'end': 13263.526, 'text': "the built in class based views that we've already gone over right.", 'start': 13259.845, 'duration': 3.681}, {'end': 13266.427, 'text': 'So I mean, this is just so much cleaner and simple.', 'start': 13263.586, 'duration': 2.841}], 'summary': 'Redundant code was replaced with a cleaner and simpler generic class based view.', 'duration': 24.248, 'max_score': 13242.179, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U413242179.jpg'}, {'end': 13371.202, 'src': 'embed', 'start': 13344.328, 'weight': 7, 'content': [{'end': 13349.33, 'text': 'What a mixin does is it allows us to extend a class based view with some new code.', 'start': 13344.328, 'duration': 5.002}, {'end': 13350.311, 'text': "Let's take a look.", 'start': 13349.791, 'duration': 0.52}, {'end': 13355.813, 'text': "So what I'm going to say is class, and we'll call this course object mixin.", 'start': 13350.871, 'duration': 4.942}, {'end': 13360.976, 'text': 'And it takes in just object as its default object is just a Python object.', 'start': 13356.534, 'duration': 4.442}, {'end': 13366.419, 'text': "And then we're going to go ahead and say that we'll give it model name.", 'start': 13361.696, 'duration': 4.723}, {'end': 13371.202, 'text': "And model class, or just simply model, and I'll give it to be none.", 'start': 13366.439, 'duration': 4.763}], 'summary': 'Mixin extends class-based view with new code.', 'duration': 26.874, 'max_score': 13344.328, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U413344328.jpg'}], 'start': 12238.364, 'title': 'Class-based views and form handling in django', 'summary': 'Covers converting function-based views to class-based views, creating detail and list views, handling parameters in urls, view creation with get and post methods, form initialization, field validation, and the benefits of using class-based views with inheritance and mixins.', 'chapters': [{'end': 12485.074, 'start': 12238.364, 'title': 'Class-based views in django', 'summary': 'Explains the process of converting a function-based view into a class-based view in django, highlighting the importance of method names in class-based views and the ease of changing templates, and also discusses handling parameters in urls.', 'duration': 246.71, 'highlights': ["The process of converting a function-based view into a class-based view involves inheriting from the base view class 'view' and ensuring that method names are correlated to the HTTP methods they handle.", "Class-based views offer the advantage of easily changing templates, as demonstrated by setting 'template_name' and accessing it using 'self.template_name'.", "Handling parameters in URLs involves passing an 'ID' parameter with a default value of 'none' in the URLs, allowing for flexibility in template rendering."]}, {'end': 12811.17, 'start': 12485.555, 'title': 'Class based views in django', 'summary': 'Discusses implementing class-based views in django, creating a detail view and a list view, setting up templates, passing context to templates, and the benefits of using class-based views with inheritance.', 'duration': 325.615, 'highlights': ['Creating a detail view and a list view', 'Passing context to templates', 'Setting up templates', 'Benefits of using class-based views with inheritance']}, {'end': 13242.159, 'start': 12815.64, 'title': 'Django view creation and form handling', 'summary': 'Covers the creation of django views with get and post methods, form initialization, field validation, and updating views with context and form instance.', 'duration': 426.519, 'highlights': ['The chapter covers the creation of Django views with get and post methods, form initialization, field validation, and updating views with context and form instance.', 'The view creation process involves defining get and post methods, initializing a form, and associating it with the context for the template.', "Field validation is demonstrated through the clean method of the form, with an example of validating the 'title' field to ensure a specific value is not entered.", 'The update view combines elements of create and detail views, requiring adjustments in the get object method and form instance initialization.', 'Errors such as a missing context in the update view are identified and rectified during the demonstration of updating views.']}, {'end': 13528.285, 'start': 13242.179, 'title': 'Class based views and mixins', 'summary': 'Discusses the benefits of using class based views and mixins, highlighting the reduction in redundant code and the simplification and cleanliness achieved through their implementation, as well as the functionality and impact of mixins on class based views.', 'duration': 286.106, 'highlights': ['The benefits of using class based views and mixins are discussed, emphasizing the reduction in redundant code and the simplification and cleanliness achieved through their implementation.', 'An explanation of how mixins function, allowing the extension of a class based view with new code, is provided, demonstrating the impact on the efficiency and functionality of class based views.', 'The process of implementing mixins to reduce code redundancy within the delete, update, create, list, and detail views is detailed, showcasing the practical application and versatility of mixins in optimizing class based views.']}], 'duration': 1289.921, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/F5mRW0jo-U4/pics/F5mRW0jo-U412238364.jpg', 'highlights': ["The process of converting a function-based view into a class-based view involves inheriting from the base view class 'view' and ensuring that method names are correlated to the HTTP methods they handle.", 'The chapter covers the creation of Django views with get and post methods, form initialization, field validation, and updating views with context and form instance.', 'The benefits of using class based views and mixins are discussed, emphasizing the reduction in redundant code and the simplification and cleanliness achieved through their implementation.', "Handling parameters in URLs involves passing an 'ID' parameter with a default value of 'none' in the URLs, allowing for flexibility in template rendering.", 'Creating a detail view and a list view', "Class-based views offer the advantage of easily changing templates, as demonstrated by setting 'template_name' and accessing it using 'self.template_name'.", 'The view creation process involves defining get and post methods, initializing a form, and associating it with the context for the template.', 'An explanation of how mixins function, allowing the extension of a class based view with new code, is provided, demonstrating the impact on the efficiency and functionality of class based views.', "Field validation is demonstrated through the clean method of the form, with an example of validating the 'title' field to ensure a specific value is not entered.", 'The update view combines elements of create and detail views, requiring adjustments in the get object method and form instance initialization.']}], 'highlights': ["The frustration of setting up the system is addressed, with a focus on refining the setup process based on the user's operating system, such as Mac OS or Windows.", 'The chapter emphasizes starting from absolute basics and gradually introducing new concepts to help learners build real web applications using Django.', 'The chapter covers fundamental components of Django, including installed apps, middleware, root URL conf, templates, WSGI application, databases, password validators, internationalization, and static files.', 'The process of making model changes and running migrations in a Django project is explained, including adding and modifying fields, running migrations, and handling default and null values in the database, with examples and commands provided (e.g., Python managed up py make migrations, Python managed up py migrate).', 'The process of using context object mapping to access object fields in the detail view is explained, emphasizing the flexibility it provides for template adjustments.', 'The importance of using post requests for form security in Django, to prevent security vulnerabilities and unauthorized data modification.', 'Rendering the form in a view involves creating an instance of the form and adding it to the context, then using form.as_p to render it out as paragraph text.', 'Changing labels, initial values, and overriding default widgets in Django form fields, demonstrating the customization of form fields, like price and description, to meet specific requirements.', "The view passes a new argument, such as ID, to the view function, improving the URL's dynamic behavior and database lookup.", "The process of converting a function-based view into a class-based view involves inheriting from the base view class 'view' and ensuring that method names are correlated to the HTTP methods they handle."]}