title
How to Build an E-commerce Website with Django and Python

description
Learn how to build an E-commerce website with Django and Python. 💻 Project code: https://github.com/justdjango/django-ecommerce 💻 Original code: https://mdbootstrap.com/freebies/jquery/e-commerce/ 🎥 Tutorial from JustDjango. Check out their Youtube Channel: https://www.youtube.com/channel/UCRM1gWNTDx0SHIqUJygD-kQ ⭐️ Course Contents ⭐️ ⌨️ (0:00:00) Setup and project configuration ⌨️ (0:16:55) Adding items to a cart ⌨️ (0:54:09) Improving the UI ⌨️ (1:10:34) Creating an order summary ⌨️ (1:38:03) The checkout process ⌨️ (2:10:46) Handling payments with Stripe ⌨️ (2:37:33) Discount codes ⌨️ (3:07:41) Managing refunds ⌨️ (3:31:31) Default addresses ⌨️ (4:12:30) Saving credit card information -- Learn to code for free and get a developer job: https://www.freecodecamp.org Read hundreds of articles on programming: https://www.freecodecamp.org/news

detail
{'title': 'How to Build an E-commerce Website with Django and Python', 'heatmap': [{'end': 948.662, 'start': 623.399, 'weight': 1}, {'end': 1737.465, 'start': 1257.072, 'weight': 0.711}], 'summary': 'Learn to build an e-commerce website using django and python, covering installation, model creation, template modification, checkout form design, payment processing with stripe api, implementing discount codes, order management, refunds, and user address management, resulting in improved user experience and a $300 savings.', 'chapters': [{'end': 292.371, 'segs': [{'end': 44.981, 'src': 'embed', 'start': 0.953, 'weight': 0, 'content': [{'end': 4.736, 'text': "Welcome to this tutorial where we're going to be building an e commerce website using Django.", 'start': 0.953, 'duration': 3.783}, {'end': 10.462, 'text': 'To get started, we can just clone this Django project boilerplate repository that we have on GitHub.', 'start': 5.317, 'duration': 5.145}, {'end': 12.884, 'text': 'So you can just copy this link.', 'start': 11.122, 'duration': 1.762}, {'end': 14.986, 'text': "And we're going to clone it here.", 'start': 13.985, 'duration': 1.001}, {'end': 22.532, 'text': "And so with that, we can then change into that repository, and I'm going to open it up in Visual Studio code.", 'start': 15.906, 'duration': 6.626}, {'end': 26.476, 'text': 'And so we can then create ourselves a virtual environment.', 'start': 23.433, 'duration': 3.043}, {'end': 28.737, 'text': "I'll then activate it.", 'start': 27.757, 'duration': 0.98}, {'end': 31.378, 'text': "And we're just going to go here into the requirements.", 'start': 29.637, 'duration': 1.741}, {'end': 42.08, 'text': "And I'm going to change this to Django 2.2, that we're going to install, we can then type pip install dash our requirements dot txt.", 'start': 32.018, 'duration': 10.062}, {'end': 44.981, 'text': 'And with that installed, we can then get started.', 'start': 43.16, 'duration': 1.821}], 'summary': 'Building an e-commerce website using django, installing django 2.2 and starting the project.', 'duration': 44.028, 'max_score': 0.953, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y953.jpg'}, {'end': 103.338, 'src': 'embed', 'start': 75.834, 'weight': 2, 'content': [{'end': 81.297, 'text': 'So now that everything is installed, we can make use of this management command that we have in our core app.', 'start': 75.834, 'duration': 5.463}, {'end': 85.44, 'text': "And that's the rename command, which allows us to rename the project.", 'start': 81.798, 'duration': 3.642}, {'end': 95.306, 'text': "So all we need to do is just call Python, manage dot pi, rename, and I'm going to call mine DJ ecommerce.", 'start': 86.12, 'duration': 9.186}, {'end': 100.657, 'text': "And now you can see it's been renamed to DJ e-commerce and there it is.", 'start': 96.775, 'duration': 3.882}, {'end': 103.338, 'text': "And let's try and run the server.", 'start': 101.557, 'duration': 1.781}], 'summary': "Using the 'rename' command, the project was successfully renamed to dj e-commerce.", 'duration': 27.504, 'max_score': 75.834, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y75834.jpg'}, {'end': 226.974, 'src': 'embed', 'start': 192.509, 'weight': 3, 'content': [{'end': 193.89, 'text': "So we'll just go to the read the docs.", 'start': 192.509, 'duration': 1.381}, {'end': 196.652, 'text': 'And we just need to install the package.', 'start': 194.711, 'duration': 1.941}, {'end': 198.994, 'text': "So let's come here, we'll stop the server.", 'start': 197.293, 'duration': 1.701}, {'end': 209.061, 'text': 'And just type pip install Django all off, then we need to bring the authentication back ends.', 'start': 200.355, 'duration': 8.706}, {'end': 219.849, 'text': "So inside DJ ecommerce settings, we'll go all the way to the bottom and add authentication.", 'start': 210.062, 'duration': 9.787}, {'end': 226.974, 'text': 'then we need to go and add all of these installed apps.', 'start': 223.191, 'duration': 3.783}], 'summary': 'Install django package, configure authentication, and add installed apps.', 'duration': 34.465, 'max_score': 192.509, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y192509.jpg'}], 'start': 0.953, 'title': 'Building e-commerce website with django and all auth installation', 'summary': 'Covers building an e-commerce website using django, including steps for cloning a project, setting up a virtual environment, and installing django 2.2. it also demonstrates renaming a django project, installing django all auth, and testing the login functionality.', 'chapters': [{'end': 74.641, 'start': 0.953, 'title': 'Building e-commerce website with django', 'summary': 'Covers building an e commerce website using django, starting with cloning a django project boilerplate repository, creating a virtual environment, and installing django 2.2.', 'duration': 73.688, 'highlights': ['Cloning the Django project boilerplate repository from GitHub is the first step in building the e-commerce website, providing an easy starting point for the development process.', 'Creating a virtual environment and installing Django 2.2 are crucial for setting up the development environment, ensuring compatibility with the project requirements.', 'Promotion of just Django.com for those interested in improving as a Django developer, offering access to exclusive video courses on Python, JavaScript, and react, with a specific focus on Django.']}, {'end': 292.371, 'start': 75.834, 'title': 'Django project renaming and all auth installation', 'summary': 'Demonstrates renaming a django project using a management command and installing django all auth for authentication, including steps for installation, configuration, and testing the login functionality.', 'duration': 216.537, 'highlights': ["The chapter demonstrates renaming a Django project using a management command, renaming it from the original name to 'DJ e-commerce', and then proceeding to run the server. It also addresses the issue of unapplied migrations after moving to Django 2.2 by executing 'Python manage.py migrate'.", "The installation and configuration of Django all auth for authentication are explained, including the steps for installing the package using 'pip install Django all off', adding authentication back ends, installed apps, specifying the site ID, adding URL patterns, and performing migrations using 'Python manage.py migrate'.", 'The tutorial provides a disclaimer that it is not suitable for absolute beginners and assumes prior knowledge of HTML, CSS, JavaScript, and Django, with a recommendation to watch other tutorials on the channel for foundational understanding before proceeding.']}], 'duration': 291.418, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y953.jpg', 'highlights': ['Cloning the Django project boilerplate repository from GitHub is the first step in building the e-commerce website, providing an easy starting point for the development process.', 'Creating a virtual environment and installing Django 2.2 are crucial for setting up the development environment, ensuring compatibility with the project requirements.', "The chapter demonstrates renaming a Django project using a management command, renaming it from the original name to 'DJ e-commerce', and then proceeding to run the server.", "The installation and configuration of Django all auth for authentication are explained, including the steps for installing the package using 'pip install Django all off', adding authentication back ends, installed apps, specifying the site ID, adding URL patterns, and performing migrations using 'Python manage.py migrate'."]}, {'end': 1202.845, 'segs': [{'end': 320.4, 'src': 'embed', 'start': 292.451, 'weight': 4, 'content': [{'end': 295.754, 'text': "So that's the basic installation of Django all auth.", 'start': 292.451, 'duration': 3.303}, {'end': 298.016, 'text': 'We will look at styling this later on.', 'start': 296.314, 'duration': 1.702}, {'end': 303.04, 'text': 'And so the next thing is going to be creating our models.', 'start': 299.197, 'duration': 3.843}, {'end': 305.582, 'text': "So we're going to do this inside core models.", 'start': 303.36, 'duration': 2.222}, {'end': 314.217, 'text': 'And this is going to be everything that defines the logic of storing an order and the process of adding an item to an order.', 'start': 307.094, 'duration': 7.123}, {'end': 320.4, 'text': "And we've touched on this in the shopping cart video that we did, which I'll link in this video as well.", 'start': 314.237, 'duration': 6.163}], 'summary': 'Installing django all auth and creating core models for storing orders and adding items.', 'duration': 27.949, 'max_score': 292.451, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y292451.jpg'}, {'end': 369.959, 'src': 'embed', 'start': 339.758, 'weight': 2, 'content': [{'end': 343.96, 'text': 'And this is so that we can link all of the order items to that order.', 'start': 339.758, 'duration': 4.202}, {'end': 347.742, 'text': 'And the order you could basically view as the shopping cart.', 'start': 345.041, 'duration': 2.701}, {'end': 352.825, 'text': 'So we store all of the items that the users added to the cart inside this order.', 'start': 348.023, 'duration': 4.802}, {'end': 354.446, 'text': 'And every time they log in,', 'start': 353.446, 'duration': 1}, {'end': 362.331, 'text': 'we fetch the order that they have and display that order with kind of like a shopping cart item count in the top right corner,', 'start': 354.446, 'duration': 7.885}, {'end': 363.951, 'text': 'like you see in most ecommerce websites.', 'start': 362.331, 'duration': 1.62}, {'end': 369.959, 'text': "And we'll also define some kind of Boolean field on the order to say whether it has been ordered or not.", 'start': 365.012, 'duration': 4.947}], 'summary': "Order items linked to order for user's shopping cart, displayed with item count and order status.", 'duration': 30.201, 'max_score': 339.758, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y339758.jpg'}, {'end': 494.592, 'src': 'embed', 'start': 461.003, 'weight': 6, 'content': [{'end': 475.693, 'text': "And we'll say on delete equals to models dot cascade, we'll add an ordered field, which we can say is models dot Boolean field default equals false.", 'start': 461.003, 'duration': 14.69}, {'end': 481.903, 'text': "And here I'll say return user dot username as the string representation.", 'start': 477.415, 'duration': 4.488}, {'end': 487.534, 'text': "Then we'll also specify the items as a many too many field.", 'start': 483.146, 'duration': 4.388}, {'end': 494.592, 'text': 'And this is of the order item, so that we can add these order items into the order.', 'start': 489.591, 'duration': 5.001}], 'summary': 'Adding cascade delete and ordered field, with many-to-many relation for order items.', 'duration': 33.589, 'max_score': 461.003, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y461003.jpg'}, {'end': 553.652, 'src': 'embed', 'start': 524.367, 'weight': 7, 'content': [{'end': 528.51, 'text': 'And then here in the order item, we can link that to this item model.', 'start': 524.367, 'duration': 4.143}, {'end': 534.255, 'text': "So we'll say the item equals models dot foreign key with the item.", 'start': 528.671, 'duration': 5.584}, {'end': 539.344, 'text': "And I'll also just specify on delete as cascade.", 'start': 534.795, 'duration': 4.549}, {'end': 543.867, 'text': "Then here in the item model, this is where we're going to define the price.", 'start': 540.385, 'duration': 3.482}, {'end': 548.109, 'text': 'So this can just be a float field, just like this.', 'start': 544.607, 'duration': 3.502}, {'end': 553.652, 'text': 'And then if we pull up in a terminal, we can try and run the server.', 'start': 549.089, 'duration': 4.563}], 'summary': 'Defining order item linking, specifying on delete as cascade, and defining price as a float field in the item model.', 'duration': 29.285, 'max_score': 524.367, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y524367.jpg'}, {'end': 767.588, 'src': 'embed', 'start': 737.071, 'weight': 1, 'content': [{'end': 738.672, 'text': 'And there we can see them coming through.', 'start': 737.071, 'duration': 1.601}, {'end': 740.493, 'text': 'Okay, cool.', 'start': 738.692, 'duration': 1.801}, {'end': 741.874, 'text': 'So everything is working so far.', 'start': 740.513, 'duration': 1.361}, {'end': 748.756, 'text': "And now what I'm going to do is go and grab a template, which is the MD bootstrap ecommerce template.", 'start': 742.514, 'duration': 6.242}, {'end': 756.983, 'text': 'So you can go to mdbootstrap.com slash freebies slash jQuery slash ecommerce.', 'start': 749.577, 'duration': 7.406}, {'end': 759.304, 'text': "And I'll also link this in the description.", 'start': 757.184, 'duration': 2.12}, {'end': 763.326, 'text': "And here you can download this for free, which we're going to use in our project.", 'start': 759.925, 'duration': 3.401}, {'end': 765.307, 'text': 'It has an MIT license.', 'start': 763.986, 'duration': 1.321}, {'end': 767.588, 'text': "So we're going to make use of this.", 'start': 765.587, 'duration': 2.001}], 'summary': 'Using md bootstrap ecommerce template with mit license.', 'duration': 30.517, 'max_score': 737.071, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y737071.jpg'}, {'end': 961.933, 'src': 'heatmap', 'start': 623.399, 'weight': 5, 'content': [{'end': 634.119, 'text': 'And then we can say this context has items, which can just be item dot objects, dot all.', 'start': 623.399, 'duration': 10.72}, {'end': 638.082, 'text': "And then we'll bring that into the core URLs.", 'start': 635.3, 'duration': 2.782}, {'end': 649.232, 'text': "So also URLs dot pi there, we'll say from Django dot URLs, import path, and then say our URL patterns equals to a list.", 'start': 638.703, 'duration': 10.529}, {'end': 660.184, 'text': "And we'll just use an empty string And then just say, from dot views, import item list.", 'start': 650.293, 'duration': 9.891}, {'end': 664.588, 'text': 'And then we can go into the DJ ecommerce URLs.', 'start': 661.265, 'duration': 3.323}, {'end': 667.411, 'text': "And we're already importing include.", 'start': 665.509, 'duration': 1.902}, {'end': 674.638, 'text': "So we'll create another path that just goes to an empty string and say, include core dot URLs.", 'start': 668.212, 'duration': 6.426}, {'end': 680.994, 'text': "And I'll also specify a namespace as core.", 'start': 676.391, 'duration': 4.603}, {'end': 686.217, 'text': 'And then if we say run the server, it says we need an app name.', 'start': 681.994, 'duration': 4.223}, {'end': 690.859, 'text': 'So here in core URLs to say app name equals core.', 'start': 686.697, 'duration': 4.162}, {'end': 692.2, 'text': 'There we go.', 'start': 691.82, 'duration': 0.38}, {'end': 699.602, 'text': "Then we can just go into the templates and I'll create item list dot html.", 'start': 693.56, 'duration': 6.042}, {'end': 703.464, 'text': "We'll say that it extends from base dot html.", 'start': 700.443, 'duration': 3.021}, {'end': 706.285, 'text': "And then we'll create a block content.", 'start': 704.284, 'duration': 2.001}, {'end': 720.81, 'text': "And inside here, we can just say, here is the list of items and say for item in items, then end for and I'll just I'll just say item.", 'start': 707.645, 'duration': 13.165}, {'end': 722.585, 'text': 'like this.', 'start': 722.185, 'duration': 0.4}, {'end': 731.289, 'text': 'And so now if we go to that base URL, where these get that rendering out, but we can also then go into the admin.', 'start': 723.726, 'duration': 7.563}, {'end': 734.931, 'text': "And we'll just create some items.", 'start': 733.51, 'duration': 1.421}, {'end': 736.571, 'text': 'There we go.', 'start': 736.071, 'duration': 0.5}, {'end': 738.672, 'text': 'And there we can see them coming through.', 'start': 737.071, 'duration': 1.601}, {'end': 740.493, 'text': 'Okay, cool.', 'start': 738.692, 'duration': 1.801}, {'end': 741.874, 'text': 'So everything is working so far.', 'start': 740.513, 'duration': 1.361}, {'end': 748.756, 'text': "And now what I'm going to do is go and grab a template, which is the MD bootstrap ecommerce template.", 'start': 742.514, 'duration': 6.242}, {'end': 756.983, 'text': 'So you can go to mdbootstrap.com slash freebies slash jQuery slash ecommerce.', 'start': 749.577, 'duration': 7.406}, {'end': 759.304, 'text': "And I'll also link this in the description.", 'start': 757.184, 'duration': 2.12}, {'end': 763.326, 'text': "And here you can download this for free, which we're going to use in our project.", 'start': 759.925, 'duration': 3.401}, {'end': 765.307, 'text': 'It has an MIT license.', 'start': 763.986, 'duration': 1.321}, {'end': 767.588, 'text': "So we're going to make use of this.", 'start': 765.587, 'duration': 2.001}, {'end': 774.551, 'text': "And so that's just because one, we don't want to spend time designing because that's not the point of Django.", 'start': 768.448, 'duration': 6.103}, {'end': 776.993, 'text': "And two, it'll look a lot nicer.", 'start': 775.431, 'duration': 1.562}, {'end': 779.636, 'text': 'And everyone likes to work with something that looks nicer.', 'start': 777.353, 'duration': 2.283}, {'end': 782.038, 'text': 'So you can go and download this for free.', 'start': 779.716, 'duration': 2.322}, {'end': 783.8, 'text': 'I already have it.', 'start': 782.058, 'duration': 1.742}, {'end': 786.142, 'text': "So I'm going to bring it into this project now.", 'start': 783.82, 'duration': 2.322}, {'end': 788.845, 'text': 'Okay, so there we can see the project.', 'start': 786.162, 'duration': 2.683}, {'end': 794.611, 'text': 'And basically, we want to take all of these static files, bring them into our static in env folder.', 'start': 789.586, 'duration': 5.025}, {'end': 797.872, 'text': 'And then everything else we can bring into the templates.', 'start': 795.531, 'duration': 2.341}, {'end': 801.932, 'text': "And I'm pretty much going to delete everything else that's not an HTML page.", 'start': 798.752, 'duration': 3.18}, {'end': 807.653, 'text': "So let's just grab all of those folders, bring them into static.", 'start': 802.612, 'duration': 5.041}, {'end': 809.394, 'text': 'So there they are.', 'start': 808.714, 'duration': 0.68}, {'end': 817.715, 'text': "And then the checkout homepage product page, I'm just going to bring into the templates.", 'start': 810.694, 'duration': 7.021}, {'end': 820.276, 'text': 'And then we can get rid of that.', 'start': 818.916, 'duration': 1.36}, {'end': 827.721, 'text': 'And so if we take a look at the home page, this is basically what our base.html needs to make use of.', 'start': 821.696, 'duration': 6.025}, {'end': 836.247, 'text': "So what I'm going to do is just go to the view here, and change this to home page dot html.", 'start': 828.481, 'duration': 7.766}, {'end': 842.291, 'text': "And then if we go back here, and refresh this, we're not going to get any styling.", 'start': 837.108, 'duration': 5.183}, {'end': 845.793, 'text': "Sure So let's go back.", 'start': 842.452, 'duration': 3.341}, {'end': 850.314, 'text': "And what I'm going to do is just add in the static reference here.", 'start': 846.933, 'duration': 3.381}, {'end': 854.375, 'text': 'So just start by saying load static.', 'start': 851.174, 'duration': 3.201}, {'end': 865.978, 'text': "And then in these h refs, and in all of these scripts here as well, and then all the images, we're going to add that static command.", 'start': 855.695, 'duration': 10.283}, {'end': 873.769, 'text': "So for example, static, like this, Okay, let's try this again.", 'start': 866.618, 'duration': 7.151}, {'end': 876.211, 'text': 'And this is what it looks like.', 'start': 873.789, 'duration': 2.422}, {'end': 883.837, 'text': "Cool And what's nice about this as well as that we get a little bit of guidance as to what we need to make work.", 'start': 877.172, 'duration': 6.665}, {'end': 891.022, 'text': "And if you've watched the tutorial series on how to build any blog with Django, then this is the same kind of concept.", 'start': 884.117, 'duration': 6.905}, {'end': 897.187, 'text': "Once you've been given a template, you just figure out what needs to be rendered and what kind of data needs to come through.", 'start': 891.222, 'duration': 5.965}, {'end': 903.192, 'text': "So immediately, just looking at some of these items, you've got a category sportwear.", 'start': 898.207, 'duration': 4.985}, {'end': 905.614, 'text': "you've got a title, gray blouse.", 'start': 903.192, 'duration': 2.422}, {'end': 907.075, 'text': "you've got a kind of tag here.", 'start': 905.614, 'duration': 1.461}, {'end': 912, 'text': "so, best seller, and you've got the price and that blue as well.", 'start': 907.075, 'duration': 4.925}, {'end': 917.064, 'text': "If we inspect that, you can see it says primary color, that's why it's blue.", 'start': 913.021, 'duration': 4.043}, {'end': 921.386, 'text': 'So we could define also a label color.', 'start': 917.825, 'duration': 3.561}, {'end': 924.507, 'text': 'And that way, then you can specify that in the model.', 'start': 921.806, 'duration': 2.701}, {'end': 931.869, 'text': "So that when you create the item, then you could output whether it's the primary color, or it's the secondary color, etc.", 'start': 925.267, 'duration': 6.602}, {'end': 936.65, 'text': "So that's some of the fields that we could then define on this model, the item model.", 'start': 932.489, 'duration': 4.161}, {'end': 939.252, 'text': 'And we also see some pagination here.', 'start': 937.45, 'duration': 1.802}, {'end': 948.662, 'text': "And if we scroll up, you've got some kind of filters that you could filter by category, a search bar, and you've got a cart item count.", 'start': 939.933, 'duration': 8.729}, {'end': 952.026, 'text': "So what I'm going to do to end off this video?", 'start': 949.403, 'duration': 2.623}, {'end': 959.112, 'text': "so, to end off this video, what I'm going to do is in these files, the checkout page and the product page,", 'start': 952.026, 'duration': 7.086}, {'end': 961.933, 'text': "I'm going to make them extend from a base dot HTML.", 'start': 959.112, 'duration': 2.821}], 'summary': 'Configuring django urls and integrating md bootstrap ecommerce template for project enhancement.', 'duration': 24.483, 'max_score': 623.399, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y623399.jpg'}, {'end': 1018.808, 'src': 'embed', 'start': 985.159, 'weight': 3, 'content': [{'end': 986.88, 'text': 'And this is what it looks like when you check out.', 'start': 985.159, 'duration': 1.721}, {'end': 992.844, 'text': 'And this is what it looks like on kind of like a product detail page, I would assume.', 'start': 988.161, 'duration': 4.683}, {'end': 998.008, 'text': 'So, now that we at least have something that we can work with in the next one,', 'start': 993.625, 'duration': 4.383}, {'end': 1004.132, 'text': 'we can start with the logic of adding to the cart and removing items from the cart and that whole checkout process.', 'start': 998.008, 'duration': 6.124}, {'end': 1010.147, 'text': "So let's just start by running the server.", 'start': 1008.482, 'duration': 1.665}, {'end': 1013.216, 'text': 'I have the virtual environment already activated.', 'start': 1010.588, 'duration': 2.628}, {'end': 1018.808, 'text': 'And so this is what it looks like.', 'start': 1017.668, 'duration': 1.14}], 'summary': 'Demonstration of adding items to cart and running the server in a virtual environment.', 'duration': 33.649, 'max_score': 985.159, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y985159.jpg'}, {'end': 1058.523, 'src': 'embed', 'start': 1033.131, 'weight': 0, 'content': [{'end': 1038.992, 'text': "So you can see like sportwear, outwear shirt, and then we'll create the label as well.", 'start': 1033.131, 'duration': 5.861}, {'end': 1045.954, 'text': "So that's going to give us this blue or red kind of label for more information about the specific item.", 'start': 1039.272, 'duration': 6.682}, {'end': 1052.159, 'text': 'We already have the price and the title, we can just go into core models and take a look.', 'start': 1046.654, 'duration': 5.505}, {'end': 1053.399, 'text': "So there's title and price.", 'start': 1052.299, 'duration': 1.1}, {'end': 1055.241, 'text': "So let's add these ones in.", 'start': 1054.16, 'duration': 1.081}, {'end': 1058.523, 'text': "We've got the category and then the label.", 'start': 1056.122, 'duration': 2.401}], 'summary': 'Creating labels for sportswear, outwear, and shirts with blue or red labels. adding title, price, and category.', 'duration': 25.392, 'max_score': 1033.131, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y1033131.jpg'}], 'start': 292.451, 'title': 'Django e-commerce models and integration', 'summary': 'Covers the creation of order and item models, integration of user authentication model, url configuration, and updating checkout and product pages in a django e-commerce project using md bootstrap template, focusing on intermediate steps and system preparation.', 'chapters': [{'end': 427.77, 'start': 292.451, 'title': 'Creating order and item models in django', 'summary': 'Covers the creation of order and item models in django, including the logic of storing an order, linking order items to an order, and defining a shopping cart item count, with a focus on creating order item and item classes as intermediate steps.', 'duration': 135.319, 'highlights': ['The order represents the shopping cart, storing all items the users added, and displaying the order with a shopping cart item count, with a Boolean field to indicate if it has been ordered or not.', 'The order item class serves as a link between the order and the item, handling specific logic about the order item and becoming an intermediate step when an item is added to the cart.', 'Creation of order and item models inside core models is highlighted, emphasizing the logic of storing an order and linking order items to an order.']}, {'end': 936.65, 'start': 430.658, 'title': 'Django e-commerce model and template integration', 'summary': 'Covers the integration of user authentication model, creation of order and item models, migration, admin registration, url configuration, template creation, and static file integration in a django e-commerce project using md bootstrap template.', 'duration': 505.992, 'highlights': ['User authentication model is associated with the order through foreign key, and an ordered field is added with a default value of false. User authentication model is associated with the order through foreign key, and an ordered field is added with a default value of false.', 'Creation of item model with a price defined as a float field, and addition of item list view in the views. Creation of item model with a price defined as a float field, and addition of item list view in the views.', 'Integration of MD Bootstrap ecommerce template for styling and presentation, and inclusion of static files and templates from the downloaded template. Integration of MD Bootstrap ecommerce template for styling and presentation, and inclusion of static files and templates from the downloaded template.']}, {'end': 1202.845, 'start': 937.45, 'title': 'Updating checkout and product pages', 'summary': 'Covers the process of updating the checkout and product pages, adding category and label choices, and making migrations, preparing the system for the logic of adding to the cart and the checkout process.', 'duration': 265.395, 'highlights': ['The chapter covers the process of updating the checkout and product pages It focuses on modifying the checkout and product pages to extend from a base dot HTML, aligning with the goal of enhancing the user interface.', 'Adding category and label choices The process involves creating category and label choices, with specific examples such as sportswear, outerwear, and shirts, and their corresponding labels, contributing to a more comprehensive product representation.', 'Making migrations to prepare for the logic of adding to the cart and the checkout process The step involves making migrations to set the stage for implementing the logic of adding to the cart, removing items, and streamlining the checkout process, indicating a crucial aspect of system preparation.']}], 'duration': 910.394, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y292451.jpg', 'highlights': ['The process involves creating category and label choices, with specific examples such as sportswear, outerwear, and shirts, and their corresponding labels, contributing to a more comprehensive product representation.', 'Integration of MD Bootstrap ecommerce template for styling and presentation, and inclusion of static files and templates from the downloaded template.', 'The order represents the shopping cart, storing all items the users added, and displaying the order with a shopping cart item count, with a Boolean field to indicate if it has been ordered or not.', 'Making migrations to prepare for the logic of adding to the cart and the checkout process. The step involves making migrations to set the stage for implementing the logic of adding to the cart, removing items, and streamlining the checkout process, indicating a crucial aspect of system preparation.', 'Creation of order and item models inside core models is highlighted, emphasizing the logic of storing an order and linking order items to an order.', 'The chapter covers the process of updating the checkout and product pages. It focuses on modifying the checkout and product pages to extend from a base dot HTML, aligning with the goal of enhancing the user interface.', 'User authentication model is associated with the order through foreign key, and an ordered field is added with a default value of false.', 'Creation of item model with a price defined as a float field, and addition of item list view in the views.']}, {'end': 2394.589, 'segs': [{'end': 1737.465, 'src': 'heatmap', 'start': 1257.072, 'weight': 0.711, 'content': [{'end': 1258.713, 'text': "It's inside the grid column.", 'start': 1257.072, 'duration': 1.641}, {'end': 1264.395, 'text': "So if we come down, you can see that that's what's repeating itself.", 'start': 1258.773, 'duration': 5.622}, {'end': 1267.636, 'text': 'So we can actually close it on the div on this column.', 'start': 1264.775, 'duration': 2.861}, {'end': 1271.878, 'text': "And you've got an entire row like that as well.", 'start': 1269.497, 'duration': 2.381}, {'end': 1275.899, 'text': "So what I'm going to do is actually just remove one of these rows.", 'start': 1272.378, 'duration': 3.521}, {'end': 1282.9, 'text': "And then if we go inside this one, I'm going to delete those three columns there.", 'start': 1276.859, 'duration': 6.041}, {'end': 1286.021, 'text': "And I'm going to remove some of these comments as well.", 'start': 1282.92, 'duration': 3.101}, {'end': 1290.759, 'text': "So inside this row, I'm going to loop through it.", 'start': 1287.282, 'duration': 3.477}, {'end': 1295.843, 'text': 'And we can go and take a look at the view that we have for home that HTML.', 'start': 1291.539, 'duration': 4.304}, {'end': 1300.187, 'text': 'So we can come here and add this context in there as well.', 'start': 1296.724, 'duration': 3.463}, {'end': 1302.589, 'text': 'And then we can loop through the items.', 'start': 1301.088, 'duration': 1.501}, {'end': 1308.034, 'text': "So we'll say for item in items, and then just say n four.", 'start': 1302.809, 'duration': 5.225}, {'end': 1320.174, 'text': "Then inside this card, we'll replace that number with item dot price, then that is the title.", 'start': 1310.356, 'duration': 9.818}, {'end': 1324.236, 'text': "So item dot title, then you've got new there.", 'start': 1320.415, 'duration': 3.821}, {'end': 1326.337, 'text': 'So this new is the label.', 'start': 1325.056, 'duration': 1.281}, {'end': 1330.499, 'text': 'So danger will replace with the label display.', 'start': 1326.697, 'duration': 3.802}, {'end': 1335.381, 'text': 'And the way that we get the display is by calling get, then the field name.', 'start': 1330.779, 'duration': 4.602}, {'end': 1338.782, 'text': 'So get underscore label underscore display.', 'start': 1336.081, 'duration': 2.701}, {'end': 1343.964, 'text': 'So this will be item dot get label display.', 'start': 1339.742, 'duration': 4.222}, {'end': 1349.482, 'text': "And I'm just going to leave it as new for now, we'll figure out how we can change that text later.", 'start': 1345.678, 'duration': 3.804}, {'end': 1352.365, 'text': 'And then this is the category.', 'start': 1349.502, 'duration': 2.863}, {'end': 1356.329, 'text': 'So very similar to get label display.', 'start': 1352.605, 'duration': 3.724}, {'end': 1361.915, 'text': 'This will be get category display.', 'start': 1356.349, 'duration': 5.566}, {'end': 1369.923, 'text': 'And if we take a look at this now, Then there we can see our two items coming through.', 'start': 1361.935, 'duration': 7.988}, {'end': 1373.304, 'text': "And what I'm going to do is actually just go back here into the view.", 'start': 1370.703, 'duration': 2.601}, {'end': 1375.685, 'text': "And I'm going to change this into a class based view.", 'start': 1373.804, 'duration': 1.881}, {'end': 1380.707, 'text': "If you haven't seen our video on class based views, then be sure to check it out.", 'start': 1376.065, 'duration': 4.642}, {'end': 1382.948, 'text': 'The link is going to display over here in the top right corner.', 'start': 1380.807, 'duration': 2.141}, {'end': 1386.429, 'text': 'And in that video, we cover everything about class based views.', 'start': 1383.848, 'duration': 2.581}, {'end': 1392.854, 'text': "So I'm gonna make use of them here because they can help in making us write a lot less code.", 'start': 1387.169, 'duration': 5.685}, {'end': 1397.537, 'text': "So what I'm going to do is just come here to the top and we'll say from Django dot, views dot.", 'start': 1392.854, 'duration': 4.683}, {'end': 1403.341, 'text': "generic Import list view and I'll import the detail view as well.", 'start': 1397.537, 'duration': 5.804}, {'end': 1409.646, 'text': 'So the home view right now is kind of like a list view, because we are listing out these items.', 'start': 1403.341, 'duration': 6.305}, {'end': 1417.692, 'text': "So what I'm going to do is just come here and we'll say class home view which inherits from the list view.", 'start': 1409.646, 'duration': 8.046}, {'end': 1427.517, 'text': "And then we just have to specify the model, which is the item, then I'll say that the template name equals to home dot html.", 'start': 1418.412, 'duration': 9.105}, {'end': 1431.479, 'text': 'And if we then take that home view, we can bring that in here.', 'start': 1428.538, 'duration': 2.941}, {'end': 1435.642, 'text': "And I'll replace it like this dot as view.", 'start': 1432.8, 'duration': 2.842}, {'end': 1438.203, 'text': 'And everything is still working.', 'start': 1436.602, 'duration': 1.601}, {'end': 1443.193, 'text': "Now if we come back here, Now they're not displaying anymore.", 'start': 1438.643, 'duration': 4.55}, {'end': 1446.815, 'text': "And that's because the context variable is different.", 'start': 1443.213, 'duration': 3.602}, {'end': 1455.1, 'text': "So if we come back up top here, where we're looping through the items, it's not items anymore, this would be object list.", 'start': 1447.115, 'duration': 7.985}, {'end': 1459.143, 'text': "There we go, now they're coming through.", 'start': 1457.922, 'duration': 1.221}, {'end': 1461.985, 'text': 'And then we can also go and define a detail view.', 'start': 1459.823, 'duration': 2.162}, {'end': 1464.706, 'text': "And I'm going to get rid of this function based view there.", 'start': 1462.225, 'duration': 2.481}, {'end': 1469.029, 'text': "So I'll say class product, detail view.", 'start': 1464.726, 'duration': 4.303}, {'end': 1472.63, 'text': 'or rather we can call it item detail view.', 'start': 1470.788, 'duration': 1.842}, {'end': 1476.475, 'text': "And that's going to inherit from the detail view.", 'start': 1474.733, 'duration': 1.742}, {'end': 1485.966, 'text': 'So the model equals to item and the template name is going to be equal to product dot HTML.', 'start': 1477.676, 'duration': 8.29}, {'end': 1489.509, 'text': "And that's basically this view here.", 'start': 1486.727, 'duration': 2.782}, {'end': 1495.974, 'text': "And if we just take a look at what that looks like, you can see it's kind of like detail view,", 'start': 1489.529, 'duration': 6.445}, {'end': 1499.397, 'text': 'even though these images have nothing to do with this item here.', 'start': 1495.974, 'duration': 3.423}, {'end': 1503.601, 'text': 'I can imagine that this is supposed to be kind of like a detail view.', 'start': 1499.397, 'duration': 4.204}, {'end': 1505.582, 'text': 'where you can add it to cart.', 'start': 1504.401, 'duration': 1.181}, {'end': 1508.324, 'text': "So we'll treat it like a detail view.", 'start': 1506.002, 'duration': 2.322}, {'end': 1515.749, 'text': "And I'm going to come into the templates and rename products to product dot html.", 'start': 1509.084, 'duration': 6.665}, {'end': 1517.85, 'text': 'And then we can save this here.', 'start': 1516.489, 'duration': 1.361}, {'end': 1521.712, 'text': 'And then inside the URLs, we can bring that view.', 'start': 1517.87, 'duration': 3.842}, {'end': 1528.724, 'text': "So item detail view, instead of products, And then we'll make it product.", 'start': 1521.733, 'duration': 6.991}, {'end': 1533.528, 'text': "And I'm going to make it taken a slug, just like that.", 'start': 1529.985, 'duration': 3.543}, {'end': 1536.03, 'text': "And I'll change the name to product there.", 'start': 1534.169, 'duration': 1.861}, {'end': 1540.094, 'text': 'And the reason this has to take in a slug is because this is a detail view.', 'start': 1537.131, 'duration': 2.963}, {'end': 1547.581, 'text': "So either we pass in a primary key or we pass in a slug for the class based view to handle which object it's getting.", 'start': 1540.294, 'duration': 7.287}, {'end': 1552.285, 'text': 'And so then here inside product or HTML, we can just scroll down a little bit.', 'start': 1548.441, 'duration': 3.844}, {'end': 1555.747, 'text': 'And this is the image there.', 'start': 1553.786, 'duration': 1.961}, {'end': 1558.108, 'text': 'Then here we have some categories.', 'start': 1556.467, 'duration': 1.641}, {'end': 1561.99, 'text': "And I'm going to get rid of two of them there because we only have one.", 'start': 1558.969, 'duration': 3.021}, {'end': 1571.796, 'text': 'So this will then be object dot get category display, where object is the default template variable name.', 'start': 1562.611, 'duration': 9.185}, {'end': 1577.68, 'text': 'And if we take a look here, that seems to be like a previous price.', 'start': 1572.736, 'duration': 4.944}, {'end': 1583.243, 'text': 'So the $100 is a discount price, which we could add in to the model as well.', 'start': 1577.92, 'duration': 5.323}, {'end': 1590.488, 'text': "But for now, what I'm going to do is just replace the 100 with object.price.", 'start': 1584.084, 'duration': 6.404}, {'end': 1598.674, 'text': "Then here in home.html, let's make sure that we can actually redirect to the absolute URL of each instance.", 'start': 1591.629, 'duration': 7.045}, {'end': 1601.576, 'text': "And I'm just going to do that here inside this href.", 'start': 1599.614, 'duration': 1.962}, {'end': 1605.917, 'text': 'So we can make sure that here on this model, we have a get absolute URL.', 'start': 1602.356, 'duration': 3.561}, {'end': 1614.24, 'text': "So I'll just say define, get absolute URL, which just takes himself.", 'start': 1606.518, 'duration': 7.722}, {'end': 1620.583, 'text': "And I'll just say that it returns a reverse, which is going to need to be imported.", 'start': 1615.181, 'duration': 5.402}, {'end': 1627.385, 'text': 'So up here at the top, we can say, from Django dot shortcuts, import reverse.', 'start': 1621.383, 'duration': 6.002}, {'end': 1633.074, 'text': "And we're going to reverse to the core namespace.", 'start': 1629.201, 'duration': 3.873}, {'end': 1635.682, 'text': "And let's just move these files around.", 'start': 1633.796, 'duration': 1.886}, {'end': 1641.123, 'text': 'and then to the product URL, like that.', 'start': 1637.441, 'duration': 3.682}, {'end': 1647.126, 'text': 'And we need to pass in the keyword arguments, where the slug will be self dot slug.', 'start': 1642.063, 'duration': 5.063}, {'end': 1650.348, 'text': 'And that means that we need to go and add a slug field here.', 'start': 1647.786, 'duration': 2.562}, {'end': 1654.13, 'text': "So we'll say slug equals models dot slug field.", 'start': 1651.108, 'duration': 3.022}, {'end': 1660.473, 'text': 'And then we can say Python managed up I make migrations are provided default.', 'start': 1654.99, 'duration': 5.483}, {'end': 1666.316, 'text': "And I'll just say, test product like that, then we can go and migrate.", 'start': 1661.333, 'duration': 4.983}, {'end': 1669.491, 'text': "And I'll run the server.", 'start': 1668.391, 'duration': 1.1}, {'end': 1674.712, 'text': 'And then here, we need to just go into the admin to fix those slugs.', 'start': 1670.772, 'duration': 3.94}, {'end': 1680.514, 'text': 'So if we go to items, this can be test product one.', 'start': 1675.733, 'duration': 4.781}, {'end': 1684.375, 'text': 'And then this can be test product two.', 'start': 1681.554, 'duration': 2.821}, {'end': 1688.096, 'text': 'Cool So now we have that reverse working.', 'start': 1686.175, 'duration': 1.921}, {'end': 1692.196, 'text': 'So we can take the get absolute URL and bring that into the home dot html.', 'start': 1688.136, 'duration': 4.06}, {'end': 1697.483, 'text': 'And here we can say item dot get absolute URL.', 'start': 1692.577, 'duration': 4.906}, {'end': 1707.35, 'text': 'And if we come back, here, then if I click on the title, then it redirects us to that URL.', 'start': 1698.566, 'duration': 8.784}, {'end': 1712.152, 'text': "And we can see that the shirt tag is coming through even though this isn't a shirt.", 'start': 1707.85, 'duration': 4.302}, {'end': 1714.913, 'text': "And we've got the $100 price there.", 'start': 1712.973, 'duration': 1.94}, {'end': 1717.815, 'text': 'And we also have a couple other fields here.', 'start': 1715.794, 'duration': 2.021}, {'end': 1724.458, 'text': "you've got a description and you've got kind of like a previous price, or rather, this is the actual price.", 'start': 1717.815, 'duration': 6.643}, {'end': 1726.399, 'text': 'And this is the discount price.', 'start': 1724.538, 'duration': 1.861}, {'end': 1729.52, 'text': 'So what we can do is we can come here on the item.', 'start': 1727.299, 'duration': 2.221}, {'end': 1733.022, 'text': "And we can say, that's the price.", 'start': 1730.601, 'duration': 2.421}, {'end': 1737.465, 'text': 'And then we can say this is the discount price.', 'start': 1733.883, 'duration': 3.582}], 'summary': 'Refactoring code, implementing class-based views, and adding slug field for product urls.', 'duration': 480.393, 'max_score': 1257.072, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y1257072.jpg'}, {'end': 1446.815, 'src': 'embed', 'start': 1392.854, 'weight': 0, 'content': [{'end': 1397.537, 'text': "So what I'm going to do is just come here to the top and we'll say from Django dot, views dot.", 'start': 1392.854, 'duration': 4.683}, {'end': 1403.341, 'text': "generic Import list view and I'll import the detail view as well.", 'start': 1397.537, 'duration': 5.804}, {'end': 1409.646, 'text': 'So the home view right now is kind of like a list view, because we are listing out these items.', 'start': 1403.341, 'duration': 6.305}, {'end': 1417.692, 'text': "So what I'm going to do is just come here and we'll say class home view which inherits from the list view.", 'start': 1409.646, 'duration': 8.046}, {'end': 1427.517, 'text': "And then we just have to specify the model, which is the item, then I'll say that the template name equals to home dot html.", 'start': 1418.412, 'duration': 9.105}, {'end': 1431.479, 'text': 'And if we then take that home view, we can bring that in here.', 'start': 1428.538, 'duration': 2.941}, {'end': 1435.642, 'text': "And I'll replace it like this dot as view.", 'start': 1432.8, 'duration': 2.842}, {'end': 1438.203, 'text': 'And everything is still working.', 'start': 1436.602, 'duration': 1.601}, {'end': 1443.193, 'text': "Now if we come back here, Now they're not displaying anymore.", 'start': 1438.643, 'duration': 4.55}, {'end': 1446.815, 'text': "And that's because the context variable is different.", 'start': 1443.213, 'duration': 3.602}], 'summary': 'Configuring home view as a list view to display items from django model.', 'duration': 53.961, 'max_score': 1392.854, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y1392854.jpg'}, {'end': 1967.218, 'src': 'embed', 'start': 1938.24, 'weight': 1, 'content': [{'end': 1941.041, 'text': 'Now if you click on that item, then it redirects you as well.', 'start': 1938.24, 'duration': 2.801}, {'end': 1945.404, 'text': "Cool So now let's look at how we can add an item to the cart.", 'start': 1942.122, 'duration': 3.282}, {'end': 1947.545, 'text': "So I'm just going to close that there.", 'start': 1946.224, 'duration': 1.321}, {'end': 1952.012, 'text': "And we're going to need to create a function that can handle that.", 'start': 1949.151, 'duration': 2.861}, {'end': 1961.076, 'text': 'So one function that will add an item to the cart, which is basically just going to take that item, create an order item,', 'start': 1952.352, 'duration': 8.724}, {'end': 1967.218, 'text': 'assign the order item to the order if the user has an order and if otherwise, then it will create that order on the spot.', 'start': 1961.076, 'duration': 6.142}], 'summary': 'Demonstrating adding an item to the cart using a function.', 'duration': 28.978, 'max_score': 1938.24, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y1938240.jpg'}, {'end': 2097.371, 'src': 'embed', 'start': 2044.47, 'weight': 3, 'content': [{'end': 2045.571, 'text': 'So we can go and do that now.', 'start': 2044.47, 'duration': 1.101}, {'end': 2049.594, 'text': "We'll say quantity equals models dot integer field.", 'start': 2046.151, 'duration': 3.443}, {'end': 2055.681, 'text': "And we'll say default equals one, so that when it's created by default, it's only one item.", 'start': 2050.255, 'duration': 5.426}, {'end': 2062.248, 'text': "So let's make migrations, and then migrate, then run the server.", 'start': 2056.563, 'duration': 5.685}, {'end': 2075.357, 'text': "So here, we're going to say that the order equals to order dot objects, dot filter, and then we'll filter it based on the user.", 'start': 2064.371, 'duration': 10.986}, {'end': 2084.44, 'text': "So we'll say where user equals request dot user, and where is ordered equals false.", 'start': 2076.117, 'duration': 8.323}, {'end': 2086.342, 'text': 'So or rather ordered.', 'start': 2084.96, 'duration': 1.382}, {'end': 2094.168, 'text': "So this way, we're making sure that we're only getting the order that has not been completed, because they might have some orders that are completed.", 'start': 2087.782, 'duration': 6.386}, {'end': 2097.371, 'text': 'So we need to make sure that we pass this into this filter.', 'start': 2094.467, 'duration': 2.904}], 'summary': 'Setting default quantity to 1 for new items. filtering orders for incomplete ones based on user.', 'duration': 52.901, 'max_score': 2044.47, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y2044470.jpg'}], 'start': 1203.505, 'title': 'Template modification, django views, and cart functionality', 'summary': 'Covers the process of modifying a template, implementing class based views in django, and creating add to cart functionality, resulting in improved user experience, reduced code, and enhanced functionality.', 'chapters': [{'end': 1286.021, 'start': 1203.505, 'title': 'Template modification process', 'summary': 'Covers the process of modifying a template, including adding a default label, removing unnecessary elements, and rearranging the layout for improved user experience.', 'duration': 82.516, 'highlights': ["Adding a default label 'P' for primary to the label", 'Removing unnecessary elements like second and third slides, controls, categories, and comments', 'Rearranging the layout by removing rows and columns for improved user experience']}, {'end': 1937.019, 'start': 1287.282, 'title': 'Django class based views implementation', 'summary': 'Demonstrates the implementation of class based views in django, including the creation of list view and detail view, and the handling of context variables, template names, and url routing, resulting in reduced code and improved functionality.', 'duration': 649.737, 'highlights': ['The implementation of class based views in Django, resulting in reduced code and improved functionality. Demonstrates the use of class based views to create list and detail views, allowing for improved code structure and functionality.', 'Handling of context variables, template names, and URL routing. Illustrates the process of handling context variables, specifying template names, and configuring URL routing for enhanced view functionality.', 'Looping through items and displaying item details in the view. Describes the process of looping through items and displaying item details in the view, contributing to a dynamic and interactive user interface.']}, {'end': 2394.589, 'start': 1938.24, 'title': 'Adding item to cart functionality', 'summary': "Discusses creating a function to add items to the cart, including creating an order item, checking for user's order, modifying item quantity, and updating the order date.", 'duration': 456.349, 'highlights': ['A function is created to add an item to the cart, which involves creating an order item, assigning the order item to the order if the user has an order, and creating the order if not, as well as removing the order item from the items field when the item is removed.', "The quantity field on the item is modified by adding 'quantity equals models.integer field' with a default of one, ensuring that by default, only one item is created.", 'The order is filtered based on the user and whether it has been completed, ensuring that only the incomplete orders are retrieved, and the order item quantity is incremented if the item is already in the cart.', "The 'add to cart' view is added to URLs, and a method 'get add to cart URL' is created on the item, allowing the functionality to be used in the template, and the order date is specified when creating the order, using 'timezone.now' to ensure proper date and time handling."]}], 'duration': 1191.084, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y1203505.jpg', 'highlights': ['The implementation of class based views in Django, resulting in reduced code and improved functionality. Demonstrates the use of class based views to create list and detail views, allowing for improved code structure and functionality.', 'A function is created to add an item to the cart, which involves creating an order item, assigning the order item to the order if the user has an order, and creating the order if not, as well as removing the order item from the items field when the item is removed.', 'Handling of context variables, template names, and URL routing. Illustrates the process of handling context variables, specifying template names, and configuring URL routing for enhanced view functionality.', "The quantity field on the item is modified by adding 'quantity equals models.integer field' with a default of one, ensuring that by default, only one item is created.", 'The order is filtered based on the user and whether it has been completed, ensuring that only the incomplete orders are retrieved, and the order item quantity is incremented if the item is already in the cart.']}, {'end': 3546.852, 'segs': [{'end': 2466.328, 'src': 'embed', 'start': 2396.534, 'weight': 0, 'content': [{'end': 2402.419, 'text': "And now let's just go back or refresh this, click Add to Cart.", 'start': 2396.534, 'duration': 5.885}, {'end': 2406.422, 'text': 'And it says Add to Cart slug is not defined.', 'start': 2403.159, 'duration': 3.263}, {'end': 2413.408, 'text': "And this is because we're using a redirect, not a reverse call here.", 'start': 2408.063, 'duration': 5.345}, {'end': 2419.572, 'text': "So let's just change this from keyword arguments to slug equals slug.", 'start': 2413.428, 'duration': 6.144}, {'end': 2423.876, 'text': "And let's come back and try that again.", 'start': 2422.074, 'duration': 1.802}, {'end': 2428.493, 'text': "Cool And let's also open up the admin so we can see.", 'start': 2426.052, 'duration': 2.441}, {'end': 2438.095, 'text': "And if we check the order items, and it says we're getting this error there, that's from our defined string method.", 'start': 2429.733, 'duration': 8.362}, {'end': 2442.356, 'text': "Let's say return, we'll actually use an F string here.", 'start': 2439.415, 'duration': 2.941}, {'end': 2447.757, 'text': "And we'll say return self dot item dot quantity.", 'start': 2443.236, 'duration': 4.521}, {'end': 2455.145, 'text': "And I'll say of self dot item that title because the item has a title.", 'start': 2448.697, 'duration': 6.448}, {'end': 2459.686, 'text': 'And this is meant to be self that quantity.', 'start': 2456.345, 'duration': 3.341}, {'end': 2466.328, 'text': "And we've got a bunch of them from pressing that button.", 'start': 2463.167, 'duration': 3.161}], 'summary': 'Fixing code errors related to add to cart functionality and order items display.', 'duration': 69.794, 'max_score': 2396.534, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y2396534.jpg'}, {'end': 2530.402, 'src': 'embed', 'start': 2492.981, 'weight': 2, 'content': [{'end': 2495.643, 'text': 'So we checked if the order item was in the order.', 'start': 2492.981, 'duration': 2.662}, {'end': 2499.205, 'text': 'So if it was, then we just added one.', 'start': 2495.903, 'duration': 3.302}, {'end': 2506.251, 'text': "But if it wasn't, so else, then we need to say, order dot items dot add.", 'start': 2499.246, 'duration': 7.005}, {'end': 2509.233, 'text': "And we're also adding the order item in there.", 'start': 2507.251, 'duration': 1.982}, {'end': 2514.986, 'text': "Cool So Let's go back and delete that order item again.", 'start': 2510.254, 'duration': 4.732}, {'end': 2523.151, 'text': "And then we'll say add to cart.", 'start': 2520.429, 'duration': 2.722}, {'end': 2528.281, 'text': 'refresh this, there it is, come back to the order.', 'start': 2524.958, 'duration': 3.323}, {'end': 2530.402, 'text': "And now we can see it's added.", 'start': 2529.181, 'duration': 1.221}], 'summary': 'Checked and added order items, then deleted and added again for successful addition.', 'duration': 37.421, 'max_score': 2492.981, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y2492981.jpg'}, {'end': 2664.894, 'src': 'embed', 'start': 2637.488, 'weight': 3, 'content': [{'end': 2640.349, 'text': "But there's a couple other conditions we're going to add in here.", 'start': 2637.488, 'duration': 2.861}, {'end': 2649.314, 'text': "So we'll say where the item equals that item, the user equals request on user, and ordered equals false.", 'start': 2641.17, 'duration': 8.144}, {'end': 2656.337, 'text': "So that makes sure this last one ordered equals false, that we're not getting an item that's already been purchased.", 'start': 2650.454, 'duration': 5.883}, {'end': 2664.894, 'text': "So if we come back here, we can actually delete both of these And then I'll come and add to cart.", 'start': 2657.378, 'duration': 7.516}], 'summary': 'Conditions added to ensure item not already purchased.', 'duration': 27.406, 'max_score': 2637.488, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y2637488.jpg'}, {'end': 2733.056, 'src': 'embed', 'start': 2700.176, 'weight': 4, 'content': [{'end': 2701.136, 'text': "Cool So that's all working.", 'start': 2700.176, 'duration': 0.96}, {'end': 2704.218, 'text': 'So we can now focus on removing from the cart.', 'start': 2701.176, 'duration': 3.042}, {'end': 2710.241, 'text': "So if we come back here, it's also similarly going to look like this.", 'start': 2705.038, 'duration': 5.203}, {'end': 2717.766, 'text': "So we'll say define, remove from cart, which takes a request and a slug.", 'start': 2710.961, 'duration': 6.805}, {'end': 2722.529, 'text': "And at the end of all of it, we're going to return a redirect back to that slug.", 'start': 2718.626, 'duration': 3.903}, {'end': 2725.991, 'text': "And we're also going to need to get that item.", 'start': 2723.51, 'duration': 2.481}, {'end': 2733.056, 'text': "And we're going to need to get the order So I'm going to copy that query set there.", 'start': 2726.892, 'duration': 6.164}], 'summary': 'Developed functionality to remove items from the cart, returning a redirect back to the slug.', 'duration': 32.88, 'max_score': 2700.176, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y2700176.jpg'}, {'end': 2922.95, 'src': 'embed', 'start': 2891.604, 'weight': 5, 'content': [{'end': 2896.114, 'text': 'So right now we have two of this item.', 'start': 2891.604, 'duration': 4.51}, {'end': 2898.119, 'text': 'So if I say remove from cart.', 'start': 2896.615, 'duration': 1.504}, {'end': 2901.558, 'text': "Let's see here.", 'start': 2900.697, 'duration': 0.861}, {'end': 2904.299, 'text': 'This still exists, which is fine.', 'start': 2902.618, 'duration': 1.681}, {'end': 2907.241, 'text': "But if we come here, now it's not there anymore.", 'start': 2904.92, 'duration': 2.321}, {'end': 2910.003, 'text': 'So it was successfully removed.', 'start': 2908.422, 'duration': 1.581}, {'end': 2916.567, 'text': "If I try remove from cart again, then we're not seeing any of the errors come through.", 'start': 2911.043, 'duration': 5.524}, {'end': 2918.148, 'text': "And that's fine.", 'start': 2916.727, 'duration': 1.421}, {'end': 2922.95, 'text': "So we'll probably want to add messages as a last touch for this video.", 'start': 2918.188, 'duration': 4.762}], 'summary': 'Successfully removed two items from cart without errors.', 'duration': 31.346, 'max_score': 2891.604, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y2891604.jpg'}, {'end': 3094.842, 'src': 'embed', 'start': 3061.867, 'weight': 7, 'content': [{'end': 3072.294, 'text': 'And actually, if you go to MD bootstrap.com, to the jQuery docs components alerts, you can actually just make use of these alerts,', 'start': 3061.867, 'duration': 10.427}, {'end': 3073.695, 'text': "which we'll use for the messages.", 'start': 3072.294, 'duration': 1.401}, {'end': 3081.403, 'text': "So I'm just going to copy that div there and instead of creating an unordered list,", 'start': 3074.635, 'duration': 6.768}, {'end': 3090.574, 'text': "I'll get rid of the unordered list and paste this over here and then the message.", 'start': 3081.403, 'duration': 9.171}, {'end': 3094.842, 'text': "I'll cut out and paste there.", 'start': 3092.199, 'duration': 2.643}], 'summary': 'Use md bootstrap alerts for messages instead of unordered lists.', 'duration': 32.975, 'max_score': 3061.867, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y3061867.jpg'}, {'end': 3288.435, 'src': 'embed', 'start': 3262.38, 'weight': 6, 'content': [{'end': 3267.382, 'text': "And in this video, we're going to focus a lot on just improving the display of the site.", 'start': 3262.38, 'duration': 5.002}, {'end': 3274.905, 'text': 'That being authentication as one part, if we go to accounts login, you can see here is our login page.', 'start': 3268.102, 'duration': 6.803}, {'end': 3277.766, 'text': "And we're going to try and style this to look a little bit better.", 'start': 3274.985, 'duration': 2.781}, {'end': 3281.709, 'text': "We also have some links that aren't working such as this products link.", 'start': 3278.406, 'duration': 3.303}, {'end': 3284.992, 'text': "And we're going to try and touch up this page as well.", 'start': 3282.39, 'duration': 2.602}, {'end': 3288.435, 'text': 'And also add a count of how many items are in our cart.', 'start': 3285.753, 'duration': 2.682}], 'summary': 'Improving site display, including styling login page and fixing broken links. also adding cart item count.', 'duration': 26.055, 'max_score': 3262.38, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y3262380.jpg'}], 'start': 2396.534, 'title': 'Fixing e-commerce functionalities', 'summary': 'Discusses debugging the add to cart functionality, updating order items, and improving site display, focusing on fixing redirect issues, preventing duplicate entries, and enhancing site styling for better user experience.', 'chapters': [{'end': 2556.482, 'start': 2396.534, 'title': 'Debugging add to cart functionality', 'summary': 'Discusses debugging the add to cart functionality, including fixing a redirect issue, modifying the string method, and addressing errors in adding and updating items, with a focus on improving the quantity handling.', 'duration': 159.948, 'highlights': ["Fixed redirect issue by changing keyword arguments to slug equals slug By changing the redirect method's keyword arguments to 'slug=slug', the issue with 'Add to Cart slug is not defined' was resolved.", "Modified string method to use F string for item quantity and title The string method was updated to use an F string to correctly display the item's quantity and title, resolving the error in the order items.", "Corrected the logic for adding and updating items in the order The logic for adding and updating items in the order was corrected to ensure proper addition and updating of items, improving the functionality of the 'Add to Cart' feature."]}, {'end': 3026.195, 'start': 2557.103, 'title': 'Updating order items and removing from cart', 'summary': 'Discusses updating order items by adding conditions to prevent duplicate entries and implementing the remove from cart function, ensuring the successful removal of items and displaying appropriate messages.', 'duration': 469.092, 'highlights': ["The chapter discusses updating order items by adding conditions to prevent duplicate entries The process involves adding conditions to ensure that the user does not get an item that's already been purchased, preventing duplicate entries, and ensuring a smooth order update process.", 'Implementing the remove from cart function, ensuring the successful removal of items The function successfully removes items from the cart, providing a seamless user experience and preventing errors during the removal process.', 'Displaying appropriate messages for successful and unsuccessful item actions Messages are displayed to inform the user when an item is added, updated, or removed from the cart, enhancing the user experience and providing clear feedback.']}, {'end': 3546.852, 'start': 3026.855, 'title': 'Improving site display and styling', 'summary': 'Details the process of improving the display and styling of the site, including adding messages and alerts, styling the login page, and removing unnecessary elements from the home page.', 'duration': 519.997, 'highlights': ['The chapter details the process of improving the display and styling of the site The transcript focuses on enhancing the visual appeal and functionality of the website, aiming to create a more user-friendly interface.', 'Adding messages and alerts for user feedback The speaker explains the process of integrating messages and alerts into the website for user feedback, enhancing the user experience.', 'Styling the login page and removing unnecessary elements from the home page The chapter covers the customization of the login page to improve aesthetics and functionality, as well as removing unnecessary elements from the home page to streamline the user interface.']}], 'duration': 1150.318, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y2396534.jpg', 'highlights': ['Fixed redirect issue by changing keyword arguments to slug equals slug', 'Modified string method to use F string for item quantity and title', 'Corrected the logic for adding and updating items in the order', 'The chapter discusses updating order items by adding conditions to prevent duplicate entries', 'Implementing the remove from cart function, ensuring the successful removal of items', 'Displaying appropriate messages for successful and unsuccessful item actions', 'The chapter details the process of improving the display and styling of the site', 'Adding messages and alerts for user feedback', 'Styling the login page and removing unnecessary elements from the home page']}, {'end': 4787.879, 'segs': [{'end': 3700.899, 'src': 'embed', 'start': 3669.309, 'weight': 0, 'content': [{'end': 3677.034, 'text': "So DJ ecommerce settings, base, and we're going to just go to the bottom here, I'll say for crispy forms.", 'start': 3669.309, 'duration': 7.725}, {'end': 3682.057, 'text': 'And this is just going to be the crispy template pack.', 'start': 3678.114, 'duration': 3.943}, {'end': 3684.559, 'text': 'which is bootstrap four.', 'start': 3683.058, 'duration': 1.501}, {'end': 3688.042, 'text': "And then in login dot html, I'll go here to the top.", 'start': 3685.26, 'duration': 2.782}, {'end': 3692.026, 'text': "And I'll just say load crispy forms tags.", 'start': 3688.763, 'duration': 3.263}, {'end': 3700.899, 'text': "And here at the form, I'll change this to crispy And then we can refresh this.", 'start': 3693.648, 'duration': 7.251}], 'summary': 'Configured dj ecommerce settings with crispy forms using bootstrap four.', 'duration': 31.59, 'max_score': 3669.309, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y3669309.jpg'}, {'end': 3781.642, 'src': 'embed', 'start': 3753.794, 'weight': 1, 'content': [{'end': 3764.026, 'text': "And down here, I'll say that the login redirect URL equals slash, so that we can at least redirect to a URL that we have on the site.", 'start': 3753.794, 'duration': 10.232}, {'end': 3766.748, 'text': "And there it says we've signed in.", 'start': 3765.467, 'duration': 1.281}, {'end': 3772.634, 'text': "And we also have the option to log out, I'm going to go and log out and just sign out there.", 'start': 3767.909, 'duration': 4.725}, {'end': 3777.599, 'text': "And let's try and log in again to see if the redirect works.", 'start': 3773.014, 'duration': 4.585}, {'end': 3778.9, 'text': 'And it does cool.', 'start': 3777.979, 'duration': 0.921}, {'end': 3781.642, 'text': 'So now we can work on this pagination.', 'start': 3779.801, 'duration': 1.841}], 'summary': 'Tested login redirect to /, successful. ready for pagination.', 'duration': 27.848, 'max_score': 3753.794, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y3753794.jpg'}, {'end': 4274.584, 'src': 'embed', 'start': 4242.947, 'weight': 2, 'content': [{'end': 4244.128, 'text': "And that's what we're going to deal with.", 'start': 4242.947, 'duration': 1.181}, {'end': 4255.671, 'text': "Now we're going to create a view that can display all of the items that are in the cart and also add functionality to either remove the item from the cart or increase the quantity of that item.", 'start': 4244.168, 'duration': 11.503}, {'end': 4257.852, 'text': "So first, we're going to need a view.", 'start': 4256.531, 'duration': 1.321}, {'end': 4261.073, 'text': "So let's come here inside core views.", 'start': 4258.272, 'duration': 2.801}, {'end': 4268.617, 'text': "And right here beneath the home view, I'm going to create the order summary view.", 'start': 4261.954, 'duration': 6.663}, {'end': 4274.584, 'text': 'And this is going to be a detail view that it inherits from.', 'start': 4271.621, 'duration': 2.963}], 'summary': 'Creating an order summary view to display cart items and modify quantities.', 'duration': 31.637, 'max_score': 4242.947, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y4242947.jpg'}, {'end': 4768.468, 'src': 'embed', 'start': 4737.844, 'weight': 3, 'content': [{'end': 4741.126, 'text': 'So we ensure that you have to be logged in to call these methods.', 'start': 4737.844, 'duration': 3.282}, {'end': 4746.449, 'text': "Then for the order summary, we're going to need to do the same kind of logic.", 'start': 4741.966, 'duration': 4.483}, {'end': 4749.131, 'text': "And we're going to use a mix in for this.", 'start': 4747.41, 'duration': 1.721}, {'end': 4752.533, 'text': 'And this is just almost from the same path.', 'start': 4750.112, 'duration': 2.421}, {'end': 4758.357, 'text': "It's from Django dot contrib dot auth dot mix ins.", 'start': 4753.234, 'duration': 5.123}, {'end': 4762.02, 'text': "And we're importing the login required mix in.", 'start': 4759.438, 'duration': 2.582}, {'end': 4768.468, 'text': 'And then we just come here and pass it in as the first argument that our class inherits from.', 'start': 4762.921, 'duration': 5.547}], 'summary': 'Methods require login, using login required mix-in from django contrib auth mix-ins.', 'duration': 30.624, 'max_score': 4737.844, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y4737844.jpg'}], 'start': 3547.973, 'title': 'Web page design, django web development, and order summary view refactoring', 'summary': 'Covers designing and installing a web page with django crispy forms, implementing login redirection, pagination, and cart item count display in django web development, and creating and refactoring order summary views, setting the foundation for further development.', 'chapters': [{'end': 3733.297, 'start': 3547.973, 'title': 'Web page design and installation', 'summary': 'Describes the process of designing and installing a web page, including adding containers, adjusting classes, and installing django crispy forms with bootstrap four, resulting in a visually consistent and appealing layout.', 'duration': 185.324, 'highlights': ['The process involves comparing different HTML files to determine the containers needed for consistent layout, resulting in a visually consistent design.', 'Installing Django crispy forms and adding the crispy template pack, bootstrap four, improves the visual appeal and layout consistency of the web page.', "Adjusting the classes and offsets, such as changing a class to 'column 6' and offsetting by three, helps in visually aligning and organizing the content on the web page.", "Adding and adjusting classes for buttons, such as changing the class for the 'sign in' button to 'button primary,' enhances the visual presentation and user experience of the web page.", "Using the 'pip install Django crispy forms' command and adding 'crispy forms' to the installed apps enhances the functionality and aesthetic appeal of the web page's form elements."]}, {'end': 4189.537, 'start': 3733.317, 'title': 'Django web development', 'summary': 'Covers implementing login redirection, pagination, and displaying cart item count using template tags in django web development.', 'duration': 456.22, 'highlights': ['Implemented login redirection and tested it successfully, redirecting to the specified URL on the site.', "Implemented pagination by specifying the 'paginate by' field on the class, with an example of displaying one item per page and dynamically changing the page number.", "Created a template tag 'cart item count' to display the count of items in the cart, filtering orders based on the user's authentication status."]}, {'end': 4365.179, 'start': 4189.557, 'title': 'Creating order summary view', 'summary': 'Demonstrates adding and removing items from the cart, creating an order summary view, and upcoming topics on the checkout form and cart functionality with code examples and future plans, setting the foundation for further development.', 'duration': 175.622, 'highlights': ['The chapter demonstrates adding and removing items from the cart Demonstrates adding and removing items from the cart, illustrating the functionality of the cart system.', 'Creating an order summary view Includes creating a detail view for the order summary, setting the foundation for displaying cart items and managing quantities.', 'Upcoming topics on the checkout form and cart functionality Mentions upcoming topics on the checkout form and managing cart functionality, indicating future plans for the development of the system.', 'Using MD Bootstrap for table styling Refers to using MD Bootstrap for table styling, specifying the source for the table styling examples.']}, {'end': 4787.879, 'start': 4366.4, 'title': 'Refactoring order summary view', 'summary': 'Focuses on refactoring the order summary view in a django application, including removing unnecessary elements, defining the get method, and displaying item information in a table, while also addressing user authentication requirements.', 'duration': 421.479, 'highlights': ['The chapter focuses on refactoring the order summary view in a Django application The transcript discusses modifying the order summary view within a Django application for improved functionality and user experience.', 'Removing unnecessary elements and defining the get method The speaker discusses removing links, buttons, and pagination from the navigation bar and defining the get method for the order summary view.', 'Displaying item information in a table The chapter details the process of creating a table to display item information such as title, price, quantity, and total item price in the order summary view.', 'Addressing user authentication requirements The speaker explains the need for user authentication requirements and demonstrates the use of login required decorators and mixins to enforce authentication for certain views.']}], 'duration': 1239.906, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y3547973.jpg', 'highlights': ['Installing Django crispy forms and adding the crispy template pack, bootstrap four, improves the visual appeal and layout consistency of the web page.', 'Implemented login redirection and tested it successfully, redirecting to the specified URL on the site.', 'Creating an order summary view Includes creating a detail view for the order summary, setting the foundation for displaying cart items and managing quantities.', 'The chapter focuses on refactoring the order summary view in a Django application The transcript discusses modifying the order summary view within a Django application for improved functionality and user experience.']}, {'end': 6160.496, 'segs': [{'end': 4985.774, 'src': 'embed', 'start': 4947.898, 'weight': 0, 'content': [{'end': 4961.78, 'text': "And if there is a discount price, then we'll say saving and then say, order item dot get amount saved.", 'start': 4947.898, 'duration': 13.882}, {'end': 4964.38, 'text': 'come back here.', 'start': 4963.72, 'duration': 0.66}, {'end': 4967.723, 'text': 'And there we see saving $300.', 'start': 4965.981, 'duration': 1.742}, {'end': 4971.465, 'text': 'And we could make this a little bit nicer with a label.', 'start': 4967.723, 'duration': 3.742}, {'end': 4975.127, 'text': 'And we can come back here to see those components.', 'start': 4972.365, 'duration': 2.762}, {'end': 4985.774, 'text': 'So if we go components, tags, labels and badges, and then just scroll down here for this span tag.', 'start': 4975.787, 'duration': 9.987}], 'summary': 'Implement discount pricing to save $300, enhance with labels and badges.', 'duration': 37.876, 'max_score': 4947.898, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y4947898.jpg'}, {'end': 5412.446, 'src': 'embed', 'start': 5383.63, 'weight': 1, 'content': [{'end': 5385.811, 'text': 'So all you can do is just continue shopping.', 'start': 5383.63, 'duration': 2.181}, {'end': 5393.894, 'text': "And then we also want to make sure if there is an order, then we display this order total, otherwise, we don't display anything.", 'start': 5386.751, 'duration': 7.143}, {'end': 5401.317, 'text': "So we'll say if object dot get total, and then say end if.", 'start': 5394.214, 'duration': 7.103}, {'end': 5404.459, 'text': 'And then we can check this out.', 'start': 5402.897, 'duration': 1.562}, {'end': 5407.862, 'text': "So let's say we go and remove those items.", 'start': 5405.299, 'duration': 2.563}, {'end': 5412.446, 'text': 'And we can actually add some buttons here, right next to the quantity.', 'start': 5408.202, 'duration': 4.244}], 'summary': 'Developing a shopping feature with order total display and item removal functionality.', 'duration': 28.816, 'max_score': 5383.63, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y5383630.jpg'}, {'end': 5506.36, 'src': 'embed', 'start': 5477.518, 'weight': 2, 'content': [{'end': 5480.82, 'text': 'And the plus is going to be the add to cart.', 'start': 5477.518, 'duration': 3.302}, {'end': 5488.566, 'text': 'Because if we take a look here at the views, we have functionality to check if that order item is already in there.', 'start': 5481.141, 'duration': 7.425}, {'end': 5490.328, 'text': "then we're just incrementing the quantity.", 'start': 5488.566, 'duration': 1.762}, {'end': 5495.712, 'text': "And then here in the remove from cart, we actually don't have that functionality.", 'start': 5491.048, 'duration': 4.664}, {'end': 5500.636, 'text': "So what I'm going to do is just copy that, paste it here.", 'start': 5496.492, 'duration': 4.144}, {'end': 5506.36, 'text': "And this is going to remove, maybe let's call this single item from cart.", 'start': 5500.716, 'duration': 5.644}], 'summary': 'Adding functionality to increment quantity and remove single item from cart.', 'duration': 28.842, 'max_score': 5477.518, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y5477518.jpg'}, {'end': 5751.266, 'src': 'embed', 'start': 5718.973, 'weight': 3, 'content': [{'end': 5727.376, 'text': "So that means here in the order summary, in this last column here, right here is where we're going to add another one of those icons.", 'start': 5718.973, 'duration': 8.403}, {'end': 5730.137, 'text': "So let's just search for trash.", 'start': 5728.256, 'duration': 1.881}, {'end': 5734.098, 'text': "And I'll copy that one, paste that there.", 'start': 5731.317, 'duration': 2.781}, {'end': 5739.24, 'text': 'And just make sure we wrap this in an anchor tag as well.', 'start': 5734.578, 'duration': 4.662}, {'end': 5747.164, 'text': 'And instead of it being removed single item, this is going to be the remove from cart.', 'start': 5742.742, 'duration': 4.422}, {'end': 5751.266, 'text': 'So that is just remove from cart.', 'start': 5748.144, 'duration': 3.122}], 'summary': 'Adding a trash icon to the order summary for removing items from cart.', 'duration': 32.293, 'max_score': 5718.973, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y5718973.jpg'}], 'start': 4787.959, 'title': 'E-commerce order processing', 'summary': 'Covers order item pricing, discounts, and savings, resulting in a $300 savings, demonstrates e-commerce website order summary including order total calculation, and discusses implementing shopping cart functionality and order summary with checkout form preparation.', 'chapters': [{'end': 5018.887, 'start': 4787.959, 'title': 'Order item pricing and discounts', 'summary': 'Explains how to calculate the total item price, discount item price, and the amount saved for an order item, demonstrating the process with a specific example, resulting in a $300 savings.', 'duration': 230.928, 'highlights': ["The method 'get total item price' is defined to calculate the total item price by multiplying the quantity with the item price.", "A method 'get total discount item price' is created to calculate the total discount item price by multiplying the quantity with the discount price.", 'The process of calculating the amount saved for an item is demonstrated, resulting in a $300 saving for a specific item.']}, {'end': 5382.41, 'start': 5019.567, 'title': 'E-commerce website order summary', 'summary': 'Demonstrates the process of adding items to the cart, updating the navigation bar, calculating the order total, and handling an empty cart on an e-commerce website.', 'duration': 362.843, 'highlights': ['The process of adding items to the cart and updating the navigation bar is shown, ensuring a seamless user experience.', 'The calculation of the order total and the method to handle an empty cart are demonstrated, contributing to efficient e-commerce functionality.', "The implementation of buttons for 'proceed to checkout' and 'continue shopping' is outlined, improving user interaction and navigation on the website."]}, {'end': 5698.898, 'start': 5383.63, 'title': 'Implementing shopping cart functionality', 'summary': 'Discusses implementing shopping cart functionality, including adding icons for item quantity adjustment, adding functionality to increment and decrement item quantity, and implementing redirects for a seamless user experience.', 'duration': 315.268, 'highlights': ['Implemented functionality to increment and decrement item quantity, ensuring a seamless user experience.', 'Added icons for item quantity adjustment, enhancing the visual appeal of the shopping cart.', 'Implemented redirects for a seamless user experience, ensuring users are directed to the appropriate views after item quantity adjustment.']}, {'end': 6160.496, 'start': 5699.218, 'title': 'Implementing order summary and checkout form', 'summary': 'Covers implementing an order summary with a trashcan icon for removing items, handling item quantity changes, and preparing a checkout form, focusing on addressing and payment method selection.', 'duration': 461.278, 'highlights': ['Implementing an order summary with a trashcan icon for removing items The speaker adds a trashcan icon to the order summary for users to remove items, providing a more efficient method than clicking a minus button to reach zero.', 'Preparing a checkout form and addressing fields The speaker discusses the process of creating a checkout form and modifying the address fields, removing unnecessary fields like first name, last name, username, and email.', 'Choosing the method of creating the Django form for the checkout process The speaker expresses a preference for using Django forms over plain HTML to accept data in the post request, emphasizing the benefits of this method.']}], 'duration': 1372.537, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y4787959.jpg', 'highlights': ['The process of calculating the amount saved for an item is demonstrated, resulting in a $300 saving for a specific item.', 'The calculation of the order total and the method to handle an empty cart are demonstrated, contributing to efficient e-commerce functionality.', 'Implemented functionality to increment and decrement item quantity, ensuring a seamless user experience.', 'Implementing an order summary with a trashcan icon for removing items The speaker adds a trashcan icon to the order summary for users to remove items, providing a more efficient method than clicking a minus button to reach zero.']}, {'end': 7650.568, 'segs': [{'end': 6211.918, 'src': 'embed', 'start': 6183.163, 'weight': 0, 'content': [{'end': 6191.45, 'text': 'And here they actually have blank label as a parameter, which can just be select country by default.', 'start': 6183.163, 'duration': 8.287}, {'end': 6192.591, 'text': 'So we can do that.', 'start': 6191.51, 'duration': 1.081}, {'end': 6196.794, 'text': "Cool So that's the country, we'll see that in action in a bit.", 'start': 6193.792, 'duration': 3.002}, {'end': 6198.996, 'text': 'Then we have the zip code.', 'start': 6197.395, 'duration': 1.601}, {'end': 6204.22, 'text': "So I'm going to say zip equals forms dot character field as well.", 'start': 6199.596, 'duration': 4.624}, {'end': 6211.918, 'text': 'And then we have this option shipping address is the same as my billing address.', 'start': 6206.934, 'duration': 4.984}], 'summary': 'Configuring parameters for country selection, zip code input, and shipping address options.', 'duration': 28.755, 'max_score': 6183.163, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y6183163.jpg'}, {'end': 6305.112, 'src': 'embed', 'start': 6275.79, 'weight': 1, 'content': [{'end': 6276.511, 'text': "So we'll come here.", 'start': 6275.79, 'duration': 0.721}, {'end': 6281.536, 'text': 'And this is going to be inside the checkout view here.', 'start': 6277.532, 'duration': 4.004}, {'end': 6284.819, 'text': "And I'm going to change this into a class based view as well.", 'start': 6282.397, 'duration': 2.422}, {'end': 6288.102, 'text': "So we'll call this the checkout view.", 'start': 6285.44, 'duration': 2.662}, {'end': 6296.31, 'text': "And I'm going to make this inherit from the default view, then we can say, define the get request.", 'start': 6288.943, 'duration': 7.367}, {'end': 6305.112, 'text': "And there, we're just going to render that self dot request.", 'start': 6300.968, 'duration': 4.144}], 'summary': 'Transforming the checkout view into a class based view, inheriting from the default view, and defining the get request to render the request.', 'duration': 29.322, 'max_score': 6275.79, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y6275790.jpg'}, {'end': 6441.662, 'src': 'embed', 'start': 6405.715, 'weight': 2, 'content': [{'end': 6409.359, 'text': "And we also have Django's crispy forms installed.", 'start': 6405.715, 'duration': 3.644}, {'end': 6415.744, 'text': 'So we can come to the top here and say load crispy forms tags.', 'start': 6409.879, 'duration': 5.865}, {'end': 6419.688, 'text': "And then here on the form, we'll say crispy.", 'start': 6417.526, 'duration': 2.162}, {'end': 6422.731, 'text': "And I'm just going to add a button as well.", 'start': 6420.949, 'duration': 1.782}, {'end': 6434.197, 'text': "And I'll just say class is button button, primary and say type is submit.", 'start': 6423.872, 'duration': 10.325}, {'end': 6436.458, 'text': "Now let's refresh this.", 'start': 6435.418, 'duration': 1.04}, {'end': 6441.662, 'text': "And up, there's a spelling mistake this CSRF.", 'start': 6438.62, 'duration': 3.042}], 'summary': "Django's crispy forms installed, adding button, fixing csrf spelling mistake.", 'duration': 35.947, 'max_score': 6405.715, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y6405715.jpg'}, {'end': 6505.845, 'src': 'embed', 'start': 6471.523, 'weight': 3, 'content': [{'end': 6478.706, 'text': "And that's very simple to fix, we can just come here and specify our payment choices.", 'start': 6471.523, 'duration': 7.183}, {'end': 6481.867, 'text': 'And this is going to be a tuple of tuples.', 'start': 6479.726, 'duration': 2.141}, {'end': 6486.829, 'text': "I'll say the first one is just s, which is for stripe.", 'start': 6482.508, 'duration': 4.321}, {'end': 6493.252, 'text': "And then the second one, we'll say is P, which is PayPal.", 'start': 6488.21, 'duration': 5.042}, {'end': 6499.418, 'text': 'And then we just specify these choices here in the radio select.', 'start': 6495.253, 'duration': 4.165}, {'end': 6503.102, 'text': 'And this is not meant to be in there.', 'start': 6501.059, 'duration': 2.043}, {'end': 6505.845, 'text': 'This is meant to be as a second argument.', 'start': 6503.802, 'duration': 2.043}], 'summary': 'The payment choices can be set as a tuple of tuples with options for stripe and paypal.', 'duration': 34.322, 'max_score': 6471.523, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y6471523.jpg'}, {'end': 6590.732, 'src': 'embed', 'start': 6557.188, 'weight': 5, 'content': [{'end': 6566.094, 'text': "And here I'll say form dot dot street address, because that's this field.", 'start': 6557.188, 'duration': 8.906}, {'end': 6572.658, 'text': "So if I come back and refresh this, now it's still there, it loses the placeholder.", 'start': 6567.055, 'duration': 5.603}, {'end': 6576.201, 'text': 'But we can come and specify the attributes inside here.', 'start': 6573.279, 'duration': 2.922}, {'end': 6580.884, 'text': "So I'll say widget equals forms dot text input.", 'start': 6576.941, 'duration': 3.943}, {'end': 6583.305, 'text': "And I'll say attributes.", 'start': 6582.005, 'duration': 1.3}, {'end': 6590.732, 'text': "where the placeholder is, let's get that exact same placeholder here.", 'start': 6584.827, 'duration': 5.905}], 'summary': 'Demonstrating form field customization with placeholder attribute.', 'duration': 33.544, 'max_score': 6557.188, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y6557188.jpg'}, {'end': 7068.127, 'src': 'embed', 'start': 7030.193, 'weight': 7, 'content': [{'end': 7033.013, 'text': 'And now everything seems to be working.', 'start': 7030.193, 'duration': 2.82}, {'end': 7037.214, 'text': 'So we can go and remove the form that we created up top.', 'start': 7033.554, 'duration': 3.66}, {'end': 7039.315, 'text': 'So that form there.', 'start': 7038.215, 'duration': 1.1}, {'end': 7046.016, 'text': 'And okay, so the styling is all gone there.', 'start': 7043.096, 'duration': 2.92}, {'end': 7049.737, 'text': 'Okay, so we can just go here to Django countries.', 'start': 7047.496, 'duration': 2.241}, {'end': 7053.078, 'text': 'And we can make use of the country select widget.', 'start': 7050.277, 'duration': 2.801}, {'end': 7055.338, 'text': 'So we can just import this.', 'start': 7053.978, 'duration': 1.36}, {'end': 7068.127, 'text': 'And then here, when we call dot form field, we can pass in the widget as this country, select widget.', 'start': 7060.925, 'duration': 7.202}], 'summary': 'Successfully integrated country select widget in django form.', 'duration': 37.934, 'max_score': 7030.193, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y7030193.jpg'}, {'end': 7157.759, 'src': 'embed', 'start': 7096.613, 'weight': 4, 'content': [{'end': 7105.236, 'text': "So we can go back here, we'll say widget equals forms dot txt input, and specify the attributes.", 'start': 7096.613, 'duration': 8.623}, {'end': 7109.118, 'text': 'And then just say class, form control.', 'start': 7106.297, 'duration': 2.821}, {'end': 7111.058, 'text': 'Come back.', 'start': 7110.618, 'duration': 0.44}, {'end': 7112.579, 'text': 'And there we go.', 'start': 7112.139, 'duration': 0.44}, {'end': 7116.86, 'text': 'Alright, so now all the styling looks fine.', 'start': 7115.259, 'duration': 1.601}, {'end': 7120.322, 'text': 'Now we can handle what happens when we actually submit the form.', 'start': 7117.36, 'duration': 2.962}, {'end': 7133.05, 'text': "So back here in the view, we have the post request, and we're just going to print that form dot cleaned data and see what comes through.", 'start': 7121.103, 'duration': 11.947}, {'end': 7136.512, 'text': "So we'll just refresh this.", 'start': 7135.211, 'duration': 1.301}, {'end': 7144.734, 'text': "enter some stuff in here, select country, I'll select both of those.", 'start': 7138.231, 'duration': 6.503}, {'end': 7146.714, 'text': "And let's say stripe continue.", 'start': 7144.794, 'duration': 1.92}, {'end': 7153.917, 'text': 'And okay, we need to make sure that form is a post request form.', 'start': 7149.716, 'duration': 4.201}, {'end': 7157.759, 'text': 'And we must add a CSRF token.', 'start': 7155.778, 'duration': 1.981}], 'summary': 'Setting up form attributes and handling form submission in a web development project.', 'duration': 61.146, 'max_score': 7096.613, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y7096613.jpg'}, {'end': 7412.906, 'src': 'embed', 'start': 7384.995, 'weight': 9, 'content': [{'end': 7388.016, 'text': "And then we're going to create a billing address.", 'start': 7384.995, 'duration': 3.021}, {'end': 7389.797, 'text': "So we'll just come here to the models.", 'start': 7388.436, 'duration': 1.361}, {'end': 7391.917, 'text': "And we're going to create this model here.", 'start': 7390.437, 'duration': 1.48}, {'end': 7402.882, 'text': "So we'll say class billing address comes from models that model, we're going to assign a user.", 'start': 7392.838, 'duration': 10.044}, {'end': 7408.004, 'text': 'And this is just going to be a foreign key, just like this user field is.', 'start': 7403.322, 'duration': 4.682}, {'end': 7412.906, 'text': "And then we're basically just going to add all the values that this form has.", 'start': 7409.005, 'duration': 3.901}], 'summary': 'Creating a billing address model with a user foreign key.', 'duration': 27.911, 'max_score': 7384.995, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y7384995.jpg'}, {'end': 7543.054, 'src': 'embed', 'start': 7514.259, 'weight': 10, 'content': [{'end': 7521.544, 'text': "we're going to need to create a field that references the billing address so that when we complete the order,", 'start': 7514.259, 'duration': 7.285}, {'end': 7527.632, 'text': 'we can then attach the billing address to know where to send it and also the shipping address.', 'start': 7521.544, 'duration': 6.088}, {'end': 7535.633, 'text': "And then we'll just add billing address here and say this is a foreign key to the billing address.", 'start': 7529.132, 'duration': 6.501}, {'end': 7543.054, 'text': "And we'll say on delete equals to let's say models dot set null.", 'start': 7536.473, 'duration': 6.581}], 'summary': 'Create a field referencing billing address for order completion, with on delete set to models.set_null.', 'duration': 28.795, 'max_score': 7514.259, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y7514259.jpg'}], 'start': 6162.217, 'title': 'Creating and styling checkout form with django', 'summary': 'Discusses creating a checkout form with django, adding fields like country, zip code, shipping address, save info, and payment options, implementing form handling in a class-based view, configuring form fields, specifying payment options, styling form elements, setting default values, handling form submission, and creating a billing address model in django, leading to a functional and visually consistent form.', 'chapters': [{'end': 6441.662, 'start': 6162.217, 'title': 'Creating checkout form with django', 'summary': 'Discusses creating a checkout form with django, including adding fields like country, zip code, shipping address, save info, and payment options, and implementing the form handling in a class-based view.', 'duration': 279.445, 'highlights': ['Adding fields like country, zip code, shipping address, save info, and payment options to the checkout form The transcript explains the process of adding multiple fields such as country, zip code, shipping address, save info, and payment options to the checkout form.', 'Implementing form handling in a class-based view The transcript details the implementation of form handling in a class-based view, including defining the get request, rendering the form, and dealing with the post request.', "Using Django's crispy forms for form rendering and adding a submit button The transcript mentions the usage of Django's crispy forms for form rendering and the addition of a submit button to the form."]}, {'end': 7029.253, 'start': 6444.725, 'title': 'Styling and configuring form fields', 'summary': 'Covers the process of configuring form fields, including specifying payment options, styling form elements, and setting default values for form fields, resulting in a functional and visually consistent form.', 'duration': 584.528, 'highlights': ["Specifying payment options using tuple of tuples The speaker specifies payment choices as a tuple of tuples, with the first tuple representing 's' for stripe and the second tuple representing 'P' for PayPal.", "Styling form elements by specifying attributes The form elements are styled by specifying attributes such as 'widget' and 'placeholder' to ensure consistent styling and functionality across various form fields.", "Setting default values and attributes for form fields Default values and attributes are set for form fields, such as 'required' and 'checked', ensuring a user-friendly and functional form interface."]}, {'end': 7384.395, 'start': 7030.193, 'title': 'Styling and handling form submission', 'summary': 'Covers styling form fields using django countries and handling form submission, including handling post requests and validating form data, leading to successful form submission.', 'duration': 354.202, 'highlights': ['Handling post requests and validating form data, leading to successful form submission.', 'Styling form fields using Django countries for country select widget and specifying attributes for form control.', 'Identifying and fixing mistakes in form fields, such as naming and value variables, to ensure correct data submission.']}, {'end': 7650.568, 'start': 7384.995, 'title': 'Creating billing address model', 'summary': 'Focuses on creating a billing address model in django, including adding fields such as street address, apartment address, country, and zip, and creating a foreign key reference to the user and the order.', 'duration': 265.573, 'highlights': ['Creating a billing address model with fields such as street address, apartment address, country, and zip. The speaker discusses the process of creating a billing address model in Django, including defining fields such as street address, apartment address, country, and zip, with specific data types and maximum lengths.', 'Adding a foreign key reference to the user and order for the billing address model. The speaker explains the addition of a foreign key reference to the user and order for the billing address model, enabling the association of billing addresses with specific users and orders.', 'Importing the billing address model and populating it with form data. The speaker demonstrates the import of the billing address model in Django and the population of its fields with form data, including user information, street address, apartment address, and country, ensuring accurate data storage and retrieval.']}], 'duration': 1488.351, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y6162217.jpg', 'highlights': ['Adding fields like country, zip code, shipping address, save info, and payment options to the checkout form', 'Implementing form handling in a class-based view', "Using Django's crispy forms for form rendering and adding a submit button", 'Specifying payment options using tuple of tuples', 'Styling form elements by specifying attributes', 'Setting default values and attributes for form fields', 'Handling post requests and validating form data, leading to successful form submission', 'Styling form fields using Django countries for country select widget and specifying attributes for form control', 'Identifying and fixing mistakes in form fields, such as naming and value variables, to ensure correct data submission', 'Creating a billing address model with fields such as street address, apartment address, country, and zip', 'Adding a foreign key reference to the user and order for the billing address model', 'Importing the billing address model and populating it with form data']}, {'end': 9431.065, 'segs': [{'end': 7734.897, 'src': 'embed', 'start': 7707.851, 'weight': 1, 'content': [{'end': 7711.836, 'text': "So if the order exists, then we'll check if the form submission was valid.", 'start': 7707.851, 'duration': 3.985}, {'end': 7716.782, 'text': "And then we will take this order here after we've saved the billing address.", 'start': 7712.677, 'duration': 4.105}, {'end': 7723.41, 'text': "And we'll say order dot billing address equals billing address and then order dot save.", 'start': 7717.423, 'duration': 5.987}, {'end': 7734.897, 'text': 'And so now, if this is a successful post request, then we also need to check which payment option was selected and redirect the user to that view.', 'start': 7724.091, 'duration': 10.806}], 'summary': 'Valid form submission triggers saving billing address and redirecting to payment view.', 'duration': 27.046, 'max_score': 7707.851, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y7707851.jpg'}, {'end': 8835.588, 'src': 'embed', 'start': 8809.776, 'weight': 0, 'content': [{'end': 8817.34, 'text': "And we're also going to want to do some error handling here for this API call because the card could fail and all the other types of errors.", 'start': 8809.776, 'duration': 7.564}, {'end': 8822.482, 'text': "So you're going to want to just search here for stripe error handling.", 'start': 8817.36, 'duration': 5.122}, {'end': 8825.924, 'text': 'And we can just go to this first one handling errors.', 'start': 8823.883, 'duration': 2.041}, {'end': 8829.265, 'text': "And then I'm going to select Python as the language.", 'start': 8826.884, 'duration': 2.381}, {'end': 8833.627, 'text': "And I'm actually just going to copy all of that.", 'start': 8831.306, 'duration': 2.321}, {'end': 8835.588, 'text': 'And we can come in here.', 'start': 8834.767, 'duration': 0.821}], 'summary': 'Implement error handling for api calls using python.', 'duration': 25.812, 'max_score': 8809.776, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y8809776.jpg'}, {'end': 9447.759, 'src': 'embed', 'start': 9415.61, 'weight': 2, 'content': [{'end': 9417.192, 'text': 'So this seems to be pretty good.', 'start': 9415.61, 'duration': 1.582}, {'end': 9424.419, 'text': "So far, we haven't covered the PayPal payment method, because there's still a bunch of other things that we want to cover in this course.", 'start': 9417.232, 'duration': 7.187}, {'end': 9428.683, 'text': "So for the time being, we're just going to leave it at having stripe as the only payment option.", 'start': 9424.459, 'duration': 4.224}, {'end': 9431.065, 'text': 'But it seems like everything is coming together.', 'start': 9429.143, 'duration': 1.922}, {'end': 9439.512, 'text': "And in the next one, we can go back to this checkout view, and we'll start handling promotional codes or discount codes.", 'start': 9431.705, 'duration': 7.807}, {'end': 9443.235, 'text': "And actually, just as a last check, let's just go back here to the admin.", 'start': 9440.153, 'duration': 3.082}, {'end': 9447.759, 'text': "And we're going to look here at the orders, because now we have a new order.", 'start': 9444.056, 'duration': 3.703}], 'summary': 'Course covers stripe as the sole payment option. next focus: handling promotional codes.', 'duration': 32.149, 'max_score': 9415.61, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y9415610.jpg'}], 'start': 7651.829, 'title': 'E-commerce payment processing', 'summary': 'Covers order processing implementation, payment handling, and error handling for stripe api calls in python. it includes handling post requests, saving billing addresses, integrating stripe and paypal payment options, and creating a payment model to track payments and link them to orders.', 'chapters': [{'end': 7873.423, 'start': 7651.829, 'title': 'Order processing and payment handling', 'summary': 'Covers the implementation of order processing, including handling post requests, saving billing addresses, and redirecting users based on the selected payment option, while also addressing the confusion around saving shipping information and the plan for future implementation.', 'duration': 221.594, 'highlights': ['The chapter covers the implementation of order processing, including handling post requests, saving billing addresses, and redirecting users based on the selected payment option Order processing, post requests, saving billing addresses, redirecting users, selected payment option', 'Addressing the confusion around saving shipping information and the plan for future implementation Confusion around saving shipping information, plan for future implementation']}, {'end': 8809.016, 'start': 7874.084, 'title': 'Handling payment options in checkout', 'summary': 'Covers the process of creating a payment view to handle payment options such as stripe and paypal, integrating stripe payment form into the checkout view, and creating a payment model to keep track of payments and link them to orders.', 'duration': 934.932, 'highlights': ['The chapter discusses creating a payment view to handle different payment options such as Stripe and PayPal, integrating these options into the checkout process. It also covers the process of creating a payment model to keep track of payments and link them to orders.', 'The transcript details the steps of integrating the Stripe payment form into the checkout view and customizing the layout of the form to fit the requirements.', 'The detailed process of handling post requests and creating charges using the Stripe API, including updating the order status and creating a payment model to track payments and link them to orders, is explained in the transcript.']}, {'end': 9431.065, 'start': 8809.776, 'title': 'Stripe api error handling', 'summary': 'Covers the implementation of error handling for stripe api calls in python, including creating error messages and redirecting for successful and failed payments, resulting in a successful payment workflow and admin interface integration for tracking payments and orders.', 'duration': 621.289, 'highlights': ['The chapter covers the implementation of error handling for Stripe API calls in Python The chapter extensively discusses the implementation of error handling specifically for Stripe API calls in Python, focusing on creating a robust error handling system.', 'Creating error messages and redirecting for successful and failed payments The implementation involves creating detailed error messages for different types of errors, such as card errors and generic Stripe errors, and redirecting users to appropriate pages for successful and failed payments.', 'Resulting in a successful payment workflow and admin interface integration for tracking payments and orders The outcome of the implementation is a successful payment workflow where payments are processed and tracked in the admin interface, providing a comprehensive view of orders and payments.']}], 'duration': 1779.236, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y7651829.jpg', 'highlights': ['The chapter extensively discusses the implementation of error handling specifically for Stripe API calls in Python, focusing on creating a robust error handling system.', 'The chapter covers the implementation of order processing, including handling post requests, saving billing addresses, and redirecting users based on the selected payment option.', 'The chapter discusses creating a payment view to handle different payment options such as Stripe and PayPal, integrating these options into the checkout process.']}, {'end': 11144.541, 'segs': [{'end': 9505.739, 'src': 'embed', 'start': 9431.705, 'weight': 0, 'content': [{'end': 9439.512, 'text': "And in the next one, we can go back to this checkout view, and we'll start handling promotional codes or discount codes.", 'start': 9431.705, 'duration': 7.807}, {'end': 9443.235, 'text': "And actually, just as a last check, let's just go back here to the admin.", 'start': 9440.153, 'duration': 3.082}, {'end': 9447.759, 'text': "And we're going to look here at the orders, because now we have a new order.", 'start': 9444.056, 'duration': 3.703}, {'end': 9452.303, 'text': 'And there you can see the billing address was added to our user.', 'start': 9447.779, 'duration': 4.524}, {'end': 9460.901, 'text': "So in this one, we're going to focus on adding discount codes to our checkout process.", 'start': 9456.397, 'duration': 4.504}, {'end': 9464.844, 'text': "I'm just going to log in here so we can see where that's coming through.", 'start': 9461.381, 'duration': 3.463}, {'end': 9470.569, 'text': 'You can just go to the cart, proceed to checkout, and here it is.', 'start': 9464.864, 'duration': 5.705}, {'end': 9473.352, 'text': "And there's one or two things that we also need to fix up.", 'start': 9471.15, 'duration': 2.202}, {'end': 9479.457, 'text': "First, it's here, if we just go to the home view, the list items of these products, they have the same image.", 'start': 9473.992, 'duration': 5.465}, {'end': 9483.4, 'text': "And that's because we don't actually have an image field on our model at the moment.", 'start': 9479.797, 'duration': 3.603}, {'end': 9486.783, 'text': "So let's just go up top to this item.", 'start': 9483.46, 'duration': 3.323}, {'end': 9494.589, 'text': "And I'm going to add models dot image field, which will be the image for that product.", 'start': 9487.603, 'duration': 6.986}, {'end': 9499.013, 'text': "And we're going to need to run pip install pillow so that we can do this.", 'start': 9494.949, 'duration': 4.064}, {'end': 9503.657, 'text': "Cool, then I'll just say put freeze into requirements.", 'start': 9500.794, 'duration': 2.863}, {'end': 9505.739, 'text': 'And then we can run the server.', 'start': 9504.618, 'duration': 1.121}], 'summary': 'Adding discount codes to checkout process, fixing image display issue, and installing necessary packages.', 'duration': 74.034, 'max_score': 9431.705, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y9431705.jpg'}, {'end': 9658.35, 'src': 'embed', 'start': 9628.783, 'weight': 12, 'content': [{'end': 9630.064, 'text': "then I'll get rid of that.", 'start': 9628.783, 'duration': 1.281}, {'end': 9632.584, 'text': "I'll change this to media route.", 'start': 9631.144, 'duration': 1.44}, {'end': 9639.407, 'text': 'And now I just moved the media directory back inside here because it was one folder outside the project.', 'start': 9633.685, 'duration': 5.722}, {'end': 9645.529, 'text': "And then I'm just going to make sure that this is renamed media route.", 'start': 9640.187, 'duration': 5.342}, {'end': 9649.511, 'text': "So now let's go back, refresh this.", 'start': 9647.19, 'duration': 2.321}, {'end': 9654.553, 'text': "And let's just make sure that we get rid of that as well.", 'start': 9651.552, 'duration': 3.001}, {'end': 9658.35, 'text': "Okay, and they still aren't displaying.", 'start': 9656.468, 'duration': 1.882}], 'summary': 'Media directory moved inside project, renamed media route, but images still not displaying.', 'duration': 29.567, 'max_score': 9628.783, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y9628783.jpg'}, {'end': 9796.133, 'src': 'embed', 'start': 9767.013, 'weight': 8, 'content': [{'end': 9775.417, 'text': "And then I'm also going to display the ordered field like this, then I'm just going to bring this in like that.", 'start': 9767.013, 'duration': 8.404}, {'end': 9778.578, 'text': "Let's come back.", 'start': 9777.978, 'duration': 0.6}, {'end': 9780.82, 'text': 'Okay, there we go.', 'start': 9780.12, 'duration': 0.7}, {'end': 9783.002, 'text': 'So now we know which ones are ordered or not.', 'start': 9781.321, 'duration': 1.681}, {'end': 9785.304, 'text': "So I'm going to go to the unordered one.", 'start': 9783.643, 'duration': 1.661}, {'end': 9789.127, 'text': 'And we see that we have this item in the order.', 'start': 9786.285, 'duration': 2.842}, {'end': 9791.709, 'text': "And so let's go and proceed to checkout.", 'start': 9789.968, 'duration': 1.741}, {'end': 9796.133, 'text': 'And just put in anything here.', 'start': 9792.71, 'duration': 3.423}], 'summary': 'Displaying ordered fields, identifying items, and proceeding to checkout.', 'duration': 29.12, 'max_score': 9767.013, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y9767013.jpg'}, {'end': 9967.095, 'src': 'embed', 'start': 9934.251, 'weight': 2, 'content': [{'end': 9936.232, 'text': 'And now we have a new order item.', 'start': 9934.251, 'duration': 1.981}, {'end': 9938.454, 'text': 'Cool So that is fixed.', 'start': 9937.013, 'duration': 1.441}, {'end': 9942.897, 'text': 'And now we can look at creating discount codes.', 'start': 9939.635, 'duration': 3.262}, {'end': 9947.5, 'text': "So what I'm going to do is in this models dot pi file, we're going to create a new class.", 'start': 9943.357, 'duration': 4.143}, {'end': 9953.024, 'text': "And this is going to be, let's say a coupon comes from models dot model.", 'start': 9947.961, 'duration': 5.063}, {'end': 9956.967, 'text': "And I'll just say that the code is a character field.", 'start': 9954.105, 'duration': 2.862}, {'end': 9961.611, 'text': "And we'll say that the maximum length is 15 characters.", 'start': 9957.988, 'duration': 3.623}, {'end': 9967.095, 'text': 'And then just say define string of self.', 'start': 9962.671, 'duration': 4.424}], 'summary': 'Creating a new class for coupon codes with a maximum length of 15 characters.', 'duration': 32.844, 'max_score': 9934.251, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y9934251.jpg'}, {'end': 10072.325, 'src': 'embed', 'start': 10041.741, 'weight': 3, 'content': [{'end': 10045.725, 'text': "And we'll go to the view, we'll come all the way down.", 'start': 10041.741, 'duration': 3.984}, {'end': 10048.487, 'text': "And we're going to create a new view.", 'start': 10047.166, 'duration': 1.321}, {'end': 10055.533, 'text': 'And this is going to be add coupon, which will just take in a request and a code.', 'start': 10048.527, 'duration': 7.006}, {'end': 10058.515, 'text': "And so we're going to want to get the users order.", 'start': 10056.113, 'duration': 2.402}, {'end': 10063.038, 'text': "So let's get all of this here.", 'start': 10059.255, 'duration': 3.783}, {'end': 10072.325, 'text': "So we could actually just call dot get And what we'll do is we'll just put it in a try statement.", 'start': 10064.219, 'duration': 8.106}], 'summary': "Creating a new 'add coupon' view to get user's order.", 'duration': 30.584, 'max_score': 10041.741, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y10041741.jpg'}, {'end': 10251.023, 'src': 'embed', 'start': 10222.292, 'weight': 10, 'content': [{'end': 10228.074, 'text': 'And then we say order dot save, and then return a redirect back to checkout.', 'start': 10222.292, 'duration': 5.782}, {'end': 10230.656, 'text': "And we'll just put a success message.", 'start': 10228.835, 'duration': 1.821}, {'end': 10237.247, 'text': "And we'll say, successfully added coupon.", 'start': 10232.216, 'duration': 5.031}, {'end': 10244.035, 'text': "We're also not doing any kind of validation right now in terms of how many times this coupon has been used.", 'start': 10238.128, 'duration': 5.907}, {'end': 10251.023, 'text': "Or if you've used this coupon before as well, those are some things that we need to take into consideration.", 'start': 10244.676, 'duration': 6.347}], 'summary': 'Implemented coupon feature with order save functionality, lacking validation for multiple uses.', 'duration': 28.731, 'max_score': 10222.292, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y10222292.jpg'}, {'end': 10923.316, 'src': 'embed', 'start': 10888.624, 'weight': 6, 'content': [{'end': 10893.046, 'text': "So I'm just going to say order dot coupon, because of the foreign key.", 'start': 10888.624, 'duration': 4.422}, {'end': 10895.867, 'text': 'And this is going to be dot code.', 'start': 10893.906, 'duration': 1.961}, {'end': 10902.089, 'text': "And then for this $5, we'll replace that with order dot coupon dot amount.", 'start': 10897.287, 'duration': 4.802}, {'end': 10909.733, 'text': 'And there we see first timer, we see minus 20.', 'start': 10906.272, 'duration': 3.461}, {'end': 10911.573, 'text': "And there's the 180 total.", 'start': 10909.733, 'duration': 1.84}, {'end': 10913.314, 'text': "So all of that's looking good.", 'start': 10912.113, 'duration': 1.201}, {'end': 10923.316, 'text': "If I go to slash payment, slash stripe, we can see it's working here as well.", 'start': 10914.034, 'duration': 9.282}], 'summary': 'Implemented foreign key order.coupon, resulting in $5 discount and $180 total. payment with stripe confirmed.', 'duration': 34.692, 'max_score': 10888.624, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y10888624.jpg'}, {'end': 11013.311, 'src': 'embed', 'start': 10956.658, 'weight': 1, 'content': [{'end': 10959.804, 'text': "Then inside order snippet, let's actually grab this value.", 'start': 10956.658, 'duration': 3.146}, {'end': 10968.526, 'text': 'We can then say, if display coupon form and end if.', 'start': 10960.946, 'duration': 7.58}, {'end': 10973.028, 'text': "So if we come back here, now we don't see the coupon form.", 'start': 10969.666, 'duration': 3.362}, {'end': 10975.489, 'text': 'This is optional if you want to handle it like this.', 'start': 10973.288, 'duration': 2.201}, {'end': 10979.551, 'text': "And so let's just go back here to the cart, proceed to checkout.", 'start': 10976.57, 'duration': 2.981}, {'end': 10981.833, 'text': 'And okay, there it is.', 'start': 10980.852, 'duration': 0.981}, {'end': 10989.577, 'text': 'And one thing that we also saw is that we were able to go to the payment view without completing the checkout form.', 'start': 10983.053, 'duration': 6.524}, {'end': 10998.702, 'text': "So we want to add some kind of condition that's saying something like if you don't have a billing address, then you can't go to the payment view yet.", 'start': 10990.397, 'duration': 8.305}, {'end': 11004.426, 'text': "So let's go to here to the payment view.", 'start': 10999.403, 'duration': 5.023}, {'end': 11013.311, 'text': "And we're just going to check here if order dot and we can come here to billing address.", 'start': 11005.186, 'duration': 8.125}], 'summary': 'Implement conditional check for billing address before proceeding to payment view.', 'duration': 56.653, 'max_score': 10956.658, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y10956658.jpg'}], 'start': 9431.705, 'title': 'Implementing discount codes and refactoring checkout process', 'summary': 'Focuses on adding discount codes to the checkout process, resolving image duplication issue, updating model with image field, creating coupon model, integrating coupon functionality, and refactoring coupon form and payment view, resulting in improved user experience and successful addition of discount codes.', 'chapters': [{'end': 9479.457, 'start': 9431.705, 'title': 'Adding discount codes to checkout process', 'summary': 'Focuses on adding discount codes to the checkout process and fixing the issue of products having the same image, with a brief mention of new orders and the billing address being added.', 'duration': 47.752, 'highlights': ['The chapter focuses on adding discount codes to the checkout process.', 'A mention of new orders and the billing address being added to the user.', 'Identifying and fixing the issue of products having the same image.']}, {'end': 9933.29, 'start': 9479.797, 'title': 'Updating model and rendering image', 'summary': 'Covers updating the model with an image field, installing necessary packages, rendering images, adjusting media and static routes, and setting ordered field for items in the order, resulting in improved functionality and user experience.', 'duration': 453.493, 'highlights': ['Updating model with image field and installing necessary package The speaker explains adding an image field to the model and installing the pillow package to enable this functionality.', 'Rendering images and adjusting media and static routes The process of rendering images on the model, adjusting media and static routes, and resolving issues related to the display of images is demonstrated.', 'Setting ordered field for items in the order The speaker explains the process of setting the ordered field for items in the order, ensuring accurate tracking and functionality.']}, {'end': 10541.334, 'start': 9934.251, 'title': 'Creating discount codes and implementing coupon system', 'summary': 'Covers the process of creating discount codes, adding a coupon model, handling coupon validation, and integrating coupon functionality into the checkout process, encompassing concepts such as creating new classes, model fields, views, url mapping, and order management.', 'duration': 607.083, 'highlights': ["Creating a new class for coupons with a character field code of maximum length 15, and integrating it into the admin. In the models.py file, a new class for coupons is created with a character field 'code' of maximum length 15, and integrated into the admin.", "Implementing a view to handle adding coupons, including validating the coupon code's existence and assigning the coupon to the order. A view is implemented to handle adding coupons, which includes validating the coupon code's existence and assigning the coupon to the order.", 'Integrating coupon functionality into the checkout process and displaying it in the order snippet. Coupon functionality is integrated into the checkout process, and displayed in the order snippet.']}, {'end': 11144.541, 'start': 10542.234, 'title': 'Refactoring coupon form and payment view', 'summary': 'Covers refactoring the coupon form and payment view to add a coupon, subtract the discount, and restrict access to the payment view without a billing address, resulting in a successful addition of a coupon, subtraction of discount, and conditional access to the payment view.', 'duration': 602.307, 'highlights': ['The chapter covers refactoring the coupon form and payment view to add a coupon, subtract the discount, and restrict access to the payment view without a billing address, resulting in a successful addition of a coupon, subtraction of discount, and conditional access to the payment view.', "The amount of the coupon is subtracted from the total value of the order, where the float field 'amount' is set to 20 and subtracted from the total, resulting in a total value of 180.", "The form is updated to include the coupon form with the action being set to 'add coupon' and the type changed to 'submit', allowing successful addition of the coupon.", "A condition is added to the payment view to restrict access if a billing address is not added, resulting in the message 'you have not added a billing address' and redirection back to the checkout."]}], 'duration': 1712.836, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y9431705.jpg', 'highlights': ['The chapter focuses on adding discount codes to the checkout process.', 'Refactoring the coupon form and payment view to add a coupon, subtract the discount, and restrict access to the payment view without a billing address, resulting in a successful addition of a coupon, subtraction of discount, and conditional access to the payment view.', 'Creating a new class for coupons with a character field code of maximum length 15, and integrating it into the admin.', "Implementing a view to handle adding coupons, including validating the coupon code's existence and assigning the coupon to the order.", 'Integrating coupon functionality into the checkout process and displaying it in the order snippet.', 'Updating model with image field and installing necessary package The speaker explains adding an image field to the model and installing the pillow package to enable this functionality.', "The amount of the coupon is subtracted from the total value of the order, where the float field 'amount' is set to 20 and subtracted from the total, resulting in a total value of 180.", 'Identifying and fixing the issue of products having the same image.', 'Setting ordered field for items in the order The speaker explains the process of setting the ordered field for items in the order, ensuring accurate tracking and functionality.', 'A mention of new orders and the billing address being added to the user.', "The form is updated to include the coupon form with the action being set to 'add coupon' and the type changed to 'submit', allowing successful addition of the coupon.", "A condition is added to the payment view to restrict access if a billing address is not added, resulting in the message 'you have not added a billing address' and redirection back to the checkout.", 'Rendering images and adjusting media and static routes The process of rendering images on the model, adjusting media and static routes, and resolving issues related to the display of images is demonstrated.']}, {'end': 11919.695, 'segs': [{'end': 11172.469, 'src': 'embed', 'start': 11145.581, 'weight': 3, 'content': [{'end': 11149.462, 'text': "And we also won't be able to go to the payment view without having a billing address first.", 'start': 11145.581, 'duration': 3.881}, {'end': 11153.363, 'text': "So let's try and complete the process and make sure that everything's working.", 'start': 11150.143, 'duration': 3.22}, {'end': 11159.505, 'text': 'And we most likely also would want to show the discount here in the order summary.', 'start': 11154.884, 'duration': 4.621}, {'end': 11168.707, 'text': "So if we go up to the order summary view, which is here, we're already passing in the order.", 'start': 11160.465, 'duration': 8.242}, {'end': 11172.469, 'text': 'So that means that we can display the coupon if there is one.', 'start': 11168.827, 'duration': 3.642}], 'summary': 'Ensure billing address, display discount in order summary view.', 'duration': 26.888, 'max_score': 11145.581, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y11145581.jpg'}, {'end': 11269.11, 'src': 'embed', 'start': 11236.184, 'weight': 0, 'content': [{'end': 11239.846, 'text': 'And just enter the stripe card number, submit payment.', 'start': 11236.184, 'duration': 3.662}, {'end': 11243.45, 'text': 'order was successful.', 'start': 11242.429, 'duration': 1.021}, {'end': 11245.953, 'text': "Let's go here, refresh it.", 'start': 11244.171, 'duration': 1.782}, {'end': 11248.877, 'text': "There's the billing address and the payment.", 'start': 11247.014, 'duration': 1.863}, {'end': 11250.619, 'text': "It's now been ordered.", 'start': 11249.738, 'duration': 0.881}, {'end': 11253.162, 'text': "And let's go check the payment value.", 'start': 11251.3, 'duration': 1.862}, {'end': 11257.287, 'text': 'And the amount is 180.', 'start': 11255.064, 'duration': 2.223}, {'end': 11260.13, 'text': 'So everything seems to be working pretty well.', 'start': 11257.287, 'duration': 2.843}, {'end': 11269.11, 'text': "So in this video, we're going to be focusing on creating kind of like an order management system.", 'start': 11264.847, 'duration': 4.263}], 'summary': 'Successfully placed an order with payment of $180, testing order management system.', 'duration': 32.926, 'max_score': 11236.184, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y11236184.jpg'}, {'end': 11454.246, 'src': 'embed', 'start': 11421.756, 'weight': 5, 'content': [{'end': 11426.958, 'text': 'And that could actually be another status that we add here in the model, which is a failed transaction.', 'start': 11421.756, 'duration': 5.202}, {'end': 11430.499, 'text': 'And this is actually something you can listen for with stripe webhooks.', 'start': 11427.118, 'duration': 3.381}, {'end': 11434.641, 'text': "So I'm going to put your failed checkout.", 'start': 11431.179, 'duration': 3.462}, {'end': 11439.802, 'text': 'And this could be due to many reasons which we saw we covered in the exceptions.', 'start': 11435.601, 'duration': 4.201}, {'end': 11444.104, 'text': 'So we could keep track of how many of each exception has occurred.', 'start': 11440.563, 'duration': 3.541}, {'end': 11454.246, 'text': "And you'd most likely be more concerned with the errors that are due to your part, not due to stripes API, for example, receiving too many requests.", 'start': 11444.264, 'duration': 9.982}], 'summary': 'Model includes failed transaction status, track exceptions, and investigate errors.', 'duration': 32.49, 'max_score': 11421.756, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y11421756.jpg'}, {'end': 11507.906, 'src': 'embed', 'start': 11473.89, 'weight': 1, 'content': [{'end': 11474.951, 'text': "There's that last one.", 'start': 11473.89, 'duration': 1.061}, {'end': 11479.974, 'text': 'And so that confirms the third process, which is payment.', 'start': 11475.691, 'duration': 4.283}, {'end': 11488.238, 'text': "then, once it has been bought because this is e commerce it means we actually have to deliver that item that they've bought to their address.", 'start': 11479.974, 'duration': 8.264}, {'end': 11497.602, 'text': "So, depending on whatever business processes you have, there's a lot that could be put in here, such as something like pre-packaging, packaging,", 'start': 11488.878, 'duration': 8.724}, {'end': 11500.623, 'text': 'processing and the whole supply chain movement there.', 'start': 11497.602, 'duration': 3.021}, {'end': 11502.664, 'text': 'And we could add this in here.', 'start': 11501.103, 'duration': 1.561}, {'end': 11507.906, 'text': 'So something like pre-processing, processing, packaging, etc.', 'start': 11502.724, 'duration': 5.182}], 'summary': "In e-commerce, the process includes payment confirmation and delivery to the customer's address, with potential steps like pre-packaging, packaging, and processing.", 'duration': 34.016, 'max_score': 11473.89, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y11473890.jpg'}, {'end': 11753.264, 'src': 'embed', 'start': 11723.89, 'weight': 2, 'content': [{'end': 11726.011, 'text': "It's ordered, has it been delivered.", 'start': 11723.89, 'duration': 2.121}, {'end': 11729.073, 'text': 'And again, you could add in pre processing, packaging, etc.', 'start': 11726.111, 'duration': 2.962}, {'end': 11733.756, 'text': 'being delivered, received, refund requested and refund granted.', 'start': 11729.754, 'duration': 4.002}, {'end': 11737.617, 'text': "And so we'll customize the admin to allow to filter by these fields.", 'start': 11734.316, 'duration': 3.301}, {'end': 11742.359, 'text': "And there's one more important field that we definitely need to add onto these orders.", 'start': 11738.138, 'duration': 4.221}, {'end': 11744.02, 'text': "And that's a reference code.", 'start': 11742.839, 'duration': 1.181}, {'end': 11751.503, 'text': "Because without a reference code, there's no way for the user to actually communicate on which order it is, we're going to get to that in a second.", 'start': 11744.58, 'duration': 6.923}, {'end': 11753.264, 'text': "But let's just customize the admin here.", 'start': 11751.523, 'duration': 1.741}], 'summary': 'Customizing admin to filter orders by delivery status and adding a reference code.', 'duration': 29.374, 'max_score': 11723.89, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y11723890.jpg'}, {'end': 11872.687, 'src': 'embed', 'start': 11845.564, 'weight': 4, 'content': [{'end': 11849.247, 'text': 'And then we can migrate, run the server again.', 'start': 11845.564, 'duration': 3.683}, {'end': 11856.093, 'text': "And so here inside our views, we're going to add a function that will create that reference code.", 'start': 11850.108, 'duration': 5.985}, {'end': 11860.776, 'text': 'And the moment we create the reference code is once the order has been purchased.', 'start': 11856.673, 'duration': 4.103}, {'end': 11864.099, 'text': "So that's going to be here in this payment view.", 'start': 11861.257, 'duration': 2.842}, {'end': 11872.687, 'text': "So if we come a little bit down here inside the try statement, When we assign the payment here, we're going to assign the reference code.", 'start': 11864.72, 'duration': 7.967}], 'summary': 'A function in the payment view creates a reference code once the order is purchased.', 'duration': 27.123, 'max_score': 11845.564, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y11845564.jpg'}], 'start': 11145.581, 'title': 'Order management in e-commerce', 'summary': 'Focuses on creating an order management system to track the lifecycle of orders, including adding items to the cart, adding a billing address, and completing payment, while also addressing the display of discounts and failed transactions. it also outlines the workflow for processing e-commerce orders, including steps for delivery, tracking, and refunds, and customizing the admin interface to manage these statuses and a reference code.', 'chapters': [{'end': 11473.11, 'start': 11145.581, 'title': 'Order management system and order lifecycle', 'summary': 'Focuses on creating an order management system to track the lifecycle of orders, including adding items to the cart, adding a billing address, and completing payment, while also addressing the display of discounts and failed transactions.', 'duration': 327.529, 'highlights': ['The chapter explains the process of creating an order management system to track the lifecycle of orders, including adding items to the cart, adding a billing address, and completing payment, while also addressing the display of discounts and failed transactions.', 'The speaker demonstrates the addition of conditions to display discounts in the order summary and addresses issues related to failed transactions during the payment process.', 'The chapter also discusses the potential addition of statuses in the order model to track failed transactions and the importance of focusing on errors related to code rather than API issues.']}, {'end': 11919.695, 'start': 11473.89, 'title': 'E-commerce order processing workflow', 'summary': 'Outlines the workflow for processing e-commerce orders, including steps for delivery, tracking, and refunds, and customizing the admin interface to manage these statuses and a reference code.', 'duration': 445.805, 'highlights': ['The workflow for processing e-commerce orders involves steps for delivery, tracking, and refunds, with the addition of statuses being delivered, received, refund requested, and refund granted. The chapter outlines the workflow for processing e-commerce orders, including steps for delivery, tracking, and refunds, and the addition of statuses being delivered, received, refund requested, and refund granted.', 'Customizing the admin interface to manage the fields for being delivered, received, refund requested, and refund granted, as well as adding a reference code for communication on orders. Customizing the admin interface to manage the fields for being delivered, received, refund requested, and refund granted, as well as adding a reference code for communication on orders.', 'Creating a function to generate a reference code once an order has been purchased, and implementing it in the payment view. Creating a function to generate a reference code once an order has been purchased, and implementing it in the payment view.']}], 'duration': 774.114, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y11145581.jpg', 'highlights': ['The chapter explains the process of creating an order management system to track the lifecycle of orders, including adding items to the cart, adding a billing address, and completing payment, while also addressing the display of discounts and failed transactions.', 'The workflow for processing e-commerce orders involves steps for delivery, tracking, and refunds, with the addition of statuses being delivered, received, refund requested, and refund granted.', 'Customizing the admin interface to manage the fields for being delivered, received, refund requested, and refund granted, as well as adding a reference code for communication on orders.', 'The speaker demonstrates the addition of conditions to display discounts in the order summary and addresses issues related to failed transactions during the payment process.', 'Creating a function to generate a reference code once an order has been purchased, and implementing it in the payment view.', 'The chapter also discusses the potential addition of statuses in the order model to track failed transactions and the importance of focusing on errors related to code rather than API issues.']}, {'end': 13015.42, 'segs': [{'end': 11948.498, 'src': 'embed', 'start': 11920.035, 'weight': 9, 'content': [{'end': 11928.101, 'text': "And then I'm going to pass in K, which is a special argument for the length of the string, which I'm going to say is 20.", 'start': 11920.035, 'duration': 8.066}, {'end': 11931.503, 'text': "And then we'll bring this method down here to our to do.", 'start': 11928.101, 'duration': 3.402}, {'end': 11937.427, 'text': "And I'll say order dot reference code equals create reference code.", 'start': 11932.204, 'duration': 5.223}, {'end': 11948.498, 'text': "So now that we're going to go and test this out, so I'll come and add this item to the cart, proceed to checkout, continue and submit payment.", 'start': 11938.248, 'duration': 10.25}], 'summary': 'Using a special argument k, a string length of 20 is set for order reference code. testing process involves adding an item to the cart, proceeding to checkout, continuing, and submitting payment.', 'duration': 28.463, 'max_score': 11920.035, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y11920035.jpg'}, {'end': 11998.179, 'src': 'embed', 'start': 11969.523, 'weight': 8, 'content': [{'end': 11974.507, 'text': "So back here in the admin, we're going to want to add a search field here.", 'start': 11969.523, 'duration': 4.984}, {'end': 11981.071, 'text': "And this is search fields, actually, which is a list of fields that we can search by, I'm going to add the user.", 'start': 11975.267, 'duration': 5.804}, {'end': 11983.592, 'text': 'so that we can search by user.', 'start': 11982.211, 'duration': 1.381}, {'end': 11988.435, 'text': "And I'm going to add reference code so we can search by reference code.", 'start': 11984.292, 'duration': 4.143}, {'end': 11992.497, 'text': 'And these are really the only two fields that we should be searching for.', 'start': 11988.895, 'duration': 3.602}, {'end': 11998.179, 'text': "So like this, if we come back into the admin, and let's just go back to the list display.", 'start': 11993.077, 'duration': 5.102}], 'summary': 'In the admin, we are adding a search field to search by user and reference code.', 'duration': 28.656, 'max_score': 11969.523, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y11969523.jpg'}, {'end': 12069.373, 'src': 'embed', 'start': 12039.993, 'weight': 7, 'content': [{'end': 12045.797, 'text': 'And we can go and add a form for users to fill in so that they can request refunds.', 'start': 12039.993, 'duration': 5.804}, {'end': 12052.882, 'text': "And then what we'll do is we will change the status of the order to have a refund requested as true.", 'start': 12046.277, 'duration': 6.605}, {'end': 12055.404, 'text': "So let's close all of this.", 'start': 12053.642, 'duration': 1.762}, {'end': 12059.366, 'text': "And all the way here at the bottom, I'm going to add a new view.", 'start': 12056.284, 'duration': 3.082}, {'end': 12069.373, 'text': "I'm going to say this is the request refund view, which will inherit from the default class based view.", 'start': 12059.366, 'duration': 10.007}], 'summary': 'Adding a form for users to request refunds and changing order status.', 'duration': 29.38, 'max_score': 12039.993, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y12039993.jpg'}, {'end': 12291.129, 'src': 'embed', 'start': 12263.39, 'weight': 5, 'content': [{'end': 12276.278, 'text': "So we'll say refund equals to a refund object, we'll say the order equals to the order, we'll say refund dot reason equals to message.", 'start': 12263.39, 'duration': 12.888}, {'end': 12278.8, 'text': 'And then we can save the refund.', 'start': 12277.239, 'duration': 1.561}, {'end': 12284.743, 'text': 'And we actually would also want to keep track of the email from the person who submitted it.', 'start': 12279.52, 'duration': 5.223}, {'end': 12287.405, 'text': 'This is just so that we can get in contact with them.', 'start': 12285.404, 'duration': 2.001}, {'end': 12291.129, 'text': "So we'll say models dot email field.", 'start': 12288.626, 'duration': 2.503}], 'summary': 'Creating a refund for an order with reason and email tracking.', 'duration': 27.739, 'max_score': 12263.39, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y12263390.jpg'}, {'end': 12674.47, 'src': 'embed', 'start': 12639.833, 'weight': 4, 'content': [{'end': 12650.523, 'text': "So I'm going to say make make refund accepted dot short description equals to And we can get an idea from here.", 'start': 12639.833, 'duration': 10.69}, {'end': 12658.705, 'text': 'So delete selected orders, this will be update orders to refund granted.', 'start': 12650.623, 'duration': 8.082}, {'end': 12669.388, 'text': 'And then we can just take this and we bring it into the actions, which is a list of functions created in this format.', 'start': 12659.305, 'duration': 10.083}, {'end': 12674.47, 'text': 'So now we have our own custom action, we can refresh the page.', 'start': 12670.009, 'duration': 4.461}], 'summary': 'Creating a custom action for refund processing in a system.', 'duration': 34.637, 'max_score': 12639.833, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y12639833.jpg'}, {'end': 12819.219, 'src': 'embed', 'start': 12789.141, 'weight': 2, 'content': [{'end': 12791.042, 'text': 'So a lot of this is going to change.', 'start': 12789.141, 'duration': 1.901}, {'end': 12793.985, 'text': "So let's just open up the models here as well.", 'start': 12791.663, 'duration': 2.322}, {'end': 12798.469, 'text': "And we'll just go here to the address.", 'start': 12795.066, 'duration': 3.403}, {'end': 12802.891, 'text': "And let's just see here, this is the billing address.", 'start': 12800.15, 'duration': 2.741}, {'end': 12807.633, 'text': 'So right now, we only have one kind of address, which is the billing address.', 'start': 12803.371, 'duration': 4.262}, {'end': 12812.196, 'text': "But what we're going to do is change this to be just a generic address.", 'start': 12807.753, 'duration': 4.443}, {'end': 12816.638, 'text': 'And then we will add a type of address here as one of the fields.', 'start': 12812.716, 'duration': 3.922}, {'end': 12819.219, 'text': "So we'll say this is the address type.", 'start': 12817.318, 'duration': 1.901}], 'summary': 'Proposing to change the billing address to a generic address with the addition of an address type field.', 'duration': 30.078, 'max_score': 12789.141, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y12789141.jpg'}, {'end': 12902.582, 'src': 'embed', 'start': 12877.118, 'weight': 6, 'content': [{'end': 12885.567, 'text': "Basically, what we'll do with this field is every time you say use this as my default billing address or use this as my default shipping address,", 'start': 12877.118, 'duration': 8.449}, {'end': 12893.576, 'text': "we'll then just grab the address you just created and then set default to be true, which you can then select in further purchases.", 'start': 12885.567, 'duration': 8.009}, {'end': 12896.079, 'text': "So that's what this field is going to allow us to do.", 'start': 12894.036, 'duration': 2.043}, {'end': 12902.582, 'text': "But now that we've changed the address, we're going to need to change this here in our order as well,", 'start': 12896.859, 'duration': 5.723}], 'summary': 'The field enables setting default addresses for billing and shipping, facilitating further purchases.', 'duration': 25.464, 'max_score': 12877.118, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y12877118.jpg'}, {'end': 13015.42, 'src': 'embed', 'start': 12983.423, 'weight': 0, 'content': [{'end': 12985.745, 'text': "So let's try and make migrations again.", 'start': 12983.423, 'duration': 2.322}, {'end': 12987.006, 'text': 'And there we go.', 'start': 12986.226, 'duration': 0.78}, {'end': 12989.689, 'text': 'Now we can migrate.', 'start': 12988.207, 'duration': 1.482}, {'end': 12993.514, 'text': "And now we're getting an integrity error.", 'start': 12991.673, 'duration': 1.841}, {'end': 12997.775, 'text': 'So the easiest way to solve this is just for us to go and delete those migrations.', 'start': 12993.894, 'duration': 3.881}, {'end': 13003.797, 'text': "So I'm going to delete that entire folder, and then delete the database as well.", 'start': 12997.995, 'duration': 5.802}, {'end': 13012.679, 'text': 'Then we can say, managed up I make migrations just for the core app.', 'start': 13005.917, 'duration': 6.762}, {'end': 13015.42, 'text': 'And then we can say migrate.', 'start': 13014.06, 'duration': 1.36}], 'summary': 'Resolved integrity error by deleting migrations and database, then successfully migrated core app.', 'duration': 31.997, 'max_score': 12983.423, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y12983423.jpg'}], 'start': 11920.035, 'title': 'Order management, refunds, and address defaults', 'summary': 'Covers the process of creating reference codes for orders, implementing search functionality, setting up refund request forms, implementing refund functionality, updating order status, and adding email tracking, as well as working on default settings for shipping and billing addresses, and updating the address model to include generic address type field, choices for billing and shipping, and a default field for setting default addresses, with the process involving changes in the order model and encountering import error and integrity error in the migration process.', 'chapters': [{'end': 12191.65, 'start': 11920.035, 'title': 'Order management and refund system', 'summary': 'Outlines the process of creating a reference code for orders, implementing a search functionality for orders by user and reference code, and setting up a refund request form including a refund model for record-keeping.', 'duration': 271.615, 'highlights': ["Implementing a reference code for orders The method for creating a reference code for orders is explained, using a special argument 'K' for the string length, set as 20.", 'Adding search functionality for orders by user and reference code The process of adding search fields for user and reference code in the admin interface is detailed, including the correction of a search field error.', 'Setting up a refund request form and refund model The creation of a refund form for users to request refunds and the implementation of a refund model for record-keeping is described, involving the use of a post method and form validation.']}, {'end': 12788.961, 'start': 12193.451, 'title': 'Handling refunds and address defaults', 'summary': 'Discusses implementing refund functionality, including updating order status and adding email tracking, while also working on default settings for shipping and billing addresses.', 'duration': 595.51, 'highlights': ['Implementing refund functionality, including updating order status and adding email tracking', 'Creating a custom action to update orders to refund granted', 'Working with default setting for shipping and billing addresses']}, {'end': 13015.42, 'start': 12789.141, 'title': 'Model address update for default billing and shipping', 'summary': 'Discusses updating the address model to include a generic address type field, choices for billing and shipping, and a default field to allow users to set default billing and shipping addresses, with the process involving changes in the order model and encountering import error and integrity error in the migration process.', 'duration': 226.279, 'highlights': ['The chapter discusses updating the address model to include a generic address type field, choices for billing and shipping, and a default field to allow users to set default billing and shipping addresses.', 'The process involves changes in the order model and encountering import error and integrity error in the migration process.', 'The address model is modified to have a type of address field, with choices for billing and shipping, and a default field to allow users to set default billing and shipping addresses.', 'The migration process encounters import error and integrity error, necessitating the deletion of migrations and the database before successfully making migrations.', 'The order model is also updated to accommodate the changes in the address model, with the addition of a shipping address and related name for the billing address and shipping address.']}], 'duration': 1095.385, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y11920035.jpg', 'highlights': ['The migration process encounters import error and integrity error, necessitating the deletion of migrations and the database before successfully making migrations.', 'The process involves changes in the order model and encountering import error and integrity error in the migration process.', 'The address model is modified to have a type of address field, with choices for billing and shipping, and a default field to allow users to set default billing and shipping addresses.', 'The chapter discusses updating the address model to include a generic address type field, choices for billing and shipping, and a default field to allow users to set default billing and shipping addresses.', 'Creating a custom action to update orders to refund granted', 'Implementing refund functionality, including updating order status and adding email tracking', 'Working with default setting for shipping and billing addresses', 'Setting up a refund request form and refund model The creation of a refund form for users to request refunds and the implementation of a refund model for record-keeping is described, involving the use of a post method and form validation.', 'Adding search functionality for orders by user and reference code The process of adding search fields for user and reference code in the admin interface is detailed, including the correction of a search field error.', "Implementing a reference code for orders The method for creating a reference code for orders is explained, using a special argument 'K' for the string length, set as 20."]}, {'end': 14397.577, 'segs': [{'end': 13077.411, 'src': 'embed', 'start': 13044.886, 'weight': 0, 'content': [{'end': 13048.869, 'text': 'Okay Then we can just copy this and register the address model.', 'start': 13044.886, 'duration': 3.983}, {'end': 13060.138, 'text': "And if we just take a look here again, we're just going to copy all these fields so that we can specify them in a custom admin model.", 'start': 13050.07, 'duration': 10.068}, {'end': 13072.147, 'text': "So we'll come here and we'll say this is the address admin which inherits from the admin dot model admin.", 'start': 13061.9, 'duration': 10.247}, {'end': 13077.411, 'text': "then we'll just say list display is all of these fields.", 'start': 13072.147, 'duration': 5.264}], 'summary': 'Copy and register address model with custom admin model.', 'duration': 32.525, 'max_score': 13044.886, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y13044886.jpg'}, {'end': 13200.812, 'src': 'embed', 'start': 13177.19, 'weight': 1, 'content': [{'end': 13184.118, 'text': 'Because if we come into the checkout form, you can see that this is all based on having one type of address, which is the billing address.', 'start': 13177.19, 'duration': 6.928}, {'end': 13193.369, 'text': 'So basically, what we want to do is duplicate all of these fields, because our form is now going to have a billing address and a shipping address.', 'start': 13184.819, 'duration': 8.55}, {'end': 13200.812, 'text': "So, to make this easier, instead of outputting all of these fields over here, we're just going to do it in plain HTML.", 'start': 13194.029, 'duration': 6.783}], 'summary': 'The checkout form is being modified to include separate billing and shipping addresses.', 'duration': 23.622, 'max_score': 13177.19, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y13177190.jpg'}, {'end': 13586.999, 'src': 'embed', 'start': 13551.395, 'weight': 2, 'content': [{'end': 13560.16, 'text': 'And we can say here, this is billing address is the same as my shipping address.', 'start': 13551.395, 'duration': 8.765}, {'end': 13565.225, 'text': "So like So that's going to be the first checkbox.", 'start': 13561.001, 'duration': 4.224}, {'end': 13571.769, 'text': 'Then the second checkbox is going to be saving this as the default shipping address.', 'start': 13566.386, 'duration': 5.383}, {'end': 13579.874, 'text': 'So we can just come here and change this text and say, save as default shipping address.', 'start': 13572.49, 'duration': 7.384}, {'end': 13586.999, 'text': "And then the name I'm going to say as set default shipping.", 'start': 13581.355, 'duration': 5.644}], 'summary': 'Updating billing address same as shipping, saving as default shipping address.', 'duration': 35.604, 'max_score': 13551.395, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y13551395.jpg'}, {'end': 14129.196, 'src': 'embed', 'start': 14098.098, 'weight': 3, 'content': [{'end': 14102.06, 'text': "And I'm just going to call it the address query set for short.", 'start': 14098.098, 'duration': 3.962}, {'end': 14108.945, 'text': "So what we want to do is first check if this user actually has a default shipping address, because if they don't,", 'start': 14103.081, 'duration': 5.864}, {'end': 14112.266, 'text': "then we're going to need to redirect back and display some sort of message.", 'start': 14108.945, 'duration': 3.321}, {'end': 14123.933, 'text': "So we'll just say if it exists, then we'll set the shipping address equals to that address query set the first value inside it.", 'start': 14112.927, 'duration': 11.006}, {'end': 14129.196, 'text': 'And then we can say else messages dot info.', 'start': 14125.254, 'duration': 3.942}], 'summary': 'Check for default shipping address; set if exists, else display message.', 'duration': 31.098, 'max_score': 14098.098, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y14098098.jpg'}], 'start': 13016.497, 'title': 'Managing user addresses in django', 'summary': 'Covers creating custom admin models for addresses, updating checkout form for billing and shipping addresses, adding checkboxes for address forms, and managing shipping and billing addresses to ensure a smooth checkout process for users.', 'chapters': [{'end': 13176.749, 'start': 13016.497, 'title': 'Creating custom admin model for address', 'summary': 'Covers creating a custom admin model for an address, adding fields like shipping address, list display links, list filter, search fields, and changing the class meta, while also registering the admin with the model.', 'duration': 160.252, 'highlights': ['Creating a custom admin model The process involves adding fields like shipping address, list display links, list filter, search fields, and changing the class meta.', 'Adding fields like shipping address, list display links, list filter, and search fields The fields added include shipping address, list display links, list filter for country, default address, address type, and search fields for user, street address, apartment address, and zip.', 'Changing the class meta The class meta is adjusted by specifying a verbose name plural for addresses.', 'Registering the admin with the model The admin is registered with the model to enable the addition and modification of addresses.']}, {'end': 13525.033, 'start': 13177.19, 'title': 'Updating checkout form for billing and shipping address', 'summary': 'Describes updating the checkout form to include separate fields for billing and shipping addresses, and modifying the form layout, placeholders, and styling to accommodate the changes, resulting in a more user-friendly and efficient checkout process.', 'duration': 347.843, 'highlights': ['Updating checkout form to include separate fields for billing and shipping addresses The speaker describes the process of duplicating form fields to accommodate separate billing and shipping addresses, resulting in a more user-friendly checkout process.', 'Modifying form layout, placeholders, and styling to accommodate changes The speaker explains the steps taken to modify the form layout, placeholders, and styling to efficiently accommodate the separate billing and shipping addresses, enhancing the user experience.', 'Setting up and customizing form fields for each address component The speaker details the process of setting up and customizing form fields for different address components such as address, country, and zip code, ensuring a comprehensive and user-friendly checkout form.']}, {'end': 14036.921, 'start': 13525.834, 'title': 'Updating address form with checkboxes', 'summary': 'Describes the process of updating an address form by adding checkboxes for same billing address, default shipping address, and default billing address using jquery and django, and ensuring that the checkboxes are only displayed if there is a default address. the process also involves handling post requests for the form.', 'duration': 511.087, 'highlights': ['The process involves updating an address form by adding checkboxes for same billing address, default shipping address, and default billing address using jQuery and Django, and ensuring that the checkboxes are only displayed if there is a default address.', 'The logic for what happens when submitting a post request for the form is being worked on.', 'The chapter also involves setting context variables based on the existence of default shipping and billing addresses, and rendering the default addresses in the context.']}, {'end': 14397.577, 'start': 14037.761, 'title': 'Managing shipping and billing addresses', 'summary': 'Covers the logic for managing shipping and billing addresses, including validation of form data, setting default addresses, and handling potential issues with empty strings, aiming to ensure a smooth checkout process for users.', 'duration': 359.816, 'highlights': ['Setting default shipping address based on user input The logic involves checking if the user has a default shipping address and redirecting if not available, with the option to set a new default address if the user is entering one.', 'Validating form data to avoid empty strings The need for validating form data, particularly for shipping and billing addresses, is highlighted to prevent issues caused by empty strings being submitted.', "Saving shipping/billing addresses to orders The process of saving shipping/billing addresses to the order is detailed, ensuring that the correct address is stored regardless of whether it's the default or a newly entered one."]}], 'duration': 1381.08, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y13016497.jpg', 'highlights': ['Creating a custom admin model The process involves adding fields like shipping address, list display links, list filter, search fields, and changing the class meta.', 'Updating checkout form to include separate fields for billing and shipping addresses The speaker describes the process of duplicating form fields to accommodate separate billing and shipping addresses, resulting in a more user-friendly checkout process.', 'The process involves updating an address form by adding checkboxes for same billing address, default shipping address, and default billing address using jQuery and Django, and ensuring that the checkboxes are only displayed if there is a default address.', 'Setting default shipping address based on user input The logic involves checking if the user has a default shipping address and redirecting if not available, with the option to set a new default address if the user is entering one.']}, {'end': 15731.178, 'segs': [{'end': 15212.565, 'src': 'embed', 'start': 15182.573, 'weight': 1, 'content': [{'end': 15185.215, 'text': 'where you could use a default billing address.', 'start': 15182.573, 'duration': 2.642}, {'end': 15190.3, 'text': "Now we're allowing you to have a default payment method, particularly with stripe.", 'start': 15185.736, 'duration': 4.564}, {'end': 15195.124, 'text': 'So basically a default card that you can use in the rest of your purchases.', 'start': 15190.5, 'duration': 4.624}, {'end': 15200.549, 'text': "So you don't have to keep on adding that card number every time you want to make a payment, you can just select that card.", 'start': 15195.144, 'duration': 5.405}, {'end': 15203.512, 'text': "And we've already gone and implemented this functionality.", 'start': 15201.289, 'duration': 2.223}, {'end': 15208.94, 'text': "So the format of this video is going to be a little bit different, in that we're not going to be building it in this video,", 'start': 15203.593, 'duration': 5.347}, {'end': 15212.565, 'text': 'rather just walking through the functionality that has been added already.', 'start': 15208.94, 'duration': 3.625}], 'summary': 'Implemented default payment method with stripe for seamless purchases.', 'duration': 29.992, 'max_score': 15182.573, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y15182573.jpg'}, {'end': 15562.261, 'src': 'embed', 'start': 15537.478, 'weight': 3, 'content': [{'end': 15542.722, 'text': 'And if it is, then what we do is we fetch the users cards, which is listed on their stripe customer.', 'start': 15537.478, 'duration': 5.244}, {'end': 15546.525, 'text': 'So what we do is just call stripe dot customer dot list sources.', 'start': 15543.342, 'duration': 3.183}, {'end': 15554.552, 'text': 'And then here you just pass in the arguments, which are the stripe, customer ID, the limit of how many results you want to get back,', 'start': 15546.685, 'duration': 7.867}, {'end': 15562.261, 'text': 'which is set to three, and then the type of object that you want to filter for, because you get many different sources that stripe actually handles.', 'start': 15554.552, 'duration': 7.709}], 'summary': "Fetch user's cards from stripe customer using stripe.customer.listsources with customer id and limit of 3.", 'duration': 24.783, 'max_score': 15537.478, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y15537478.jpg'}, {'end': 15603.771, 'src': 'embed', 'start': 15575.773, 'weight': 0, 'content': [{'end': 15581.637, 'text': "So we're checking if the list of that card is greater than zero, then we just update the context to have a card.", 'start': 15575.773, 'duration': 5.864}, {'end': 15588.802, 'text': 'And then that card we output here in our HTML by just using some template syntax here.', 'start': 15582.758, 'duration': 6.044}, {'end': 15593.765, 'text': "So we just say if there's a card, we output just another div, which has a checkbox in it.", 'start': 15589.042, 'duration': 4.723}, {'end': 15595.326, 'text': 'And inside it.', 'start': 15594.445, 'duration': 0.881}, {'end': 15603.771, 'text': "here you can see we're outputting, for example, the last four, which are the last four digits on the card, the expiration month, the expiration year.", 'start': 15595.326, 'duration': 8.445}], 'summary': 'Checking if the list of cards is greater than zero and updating the context to have a card, then outputting card details in html using template syntax.', 'duration': 27.998, 'max_score': 15575.773, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y15575773.jpg'}, {'end': 15691.983, 'src': 'embed', 'start': 15662.633, 'weight': 2, 'content': [{'end': 15672.099, 'text': "Now let's just go back here and what I'll do is input some credit card information, click save for future purchases and click submit.", 'start': 15662.633, 'duration': 9.466}, {'end': 15675.24, 'text': 'Cool And so now the order was successful.', 'start': 15673.18, 'duration': 2.06}, {'end': 15681.041, 'text': 'And if we check the admin, the customer ID is now there, one click purchasing is now there.', 'start': 15675.881, 'duration': 5.16}, {'end': 15691.983, 'text': "So if we try and add something, again, and let's just go to use default, and select stripe, continue to check out.", 'start': 15681.642, 'duration': 10.341}], 'summary': 'Successful order with credit card saved for future purchases, enabling one-click purchasing and customer id added to admin.', 'duration': 29.35, 'max_score': 15662.633, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y15662633.jpg'}], 'start': 14398.637, 'title': 'Managing user addresses, profiles, and payment methods', 'summary': 'Explains creating and managing shipping and billing addresses, implementing default address and payment method functionality with jquery, user profile model creation, and stripe card handling for secure and efficient payment processing.', 'chapters': [{'end': 14861.847, 'start': 14398.637, 'title': 'Creating shipping and billing addresses', 'summary': 'Explains the process of creating and managing shipping and billing addresses, including validating required fields and setting default addresses, with a demonstration of testing different scenarios and the final working outcome.', 'duration': 463.21, 'highlights': ['Creating logic to validate and set shipping and billing addresses, including required fields and default addresses, with a demonstration of testing different scenarios.', 'Testing and demonstrating the functionality of creating and managing shipping and billing addresses, including setting default addresses and testing different scenarios.', 'Explaining the process of creating and managing shipping and billing addresses, including validating required fields and setting default addresses, with a demonstration of testing different scenarios.']}, {'end': 15288.386, 'start': 14863.529, 'title': 'Implementing default address functionality with jquery', 'summary': 'Demonstrates how to implement default address and default payment method functionality using jquery, allowing users to select default addresses and cards, reducing the need to input information repeatedly and enhancing user experience.', 'duration': 424.857, 'highlights': ['The chapter focuses on adding functionality to allow users to have a default payment method, particularly with stripe, reducing the need to input card details for every purchase. Demonstration of adding functionality for default payment method with stripe, reducing manual input for card details.', 'Implementing default address functionality using jQuery, providing a better way for users to enter information by providing a default option and controlling information accurately. Explanation of implementing default address functionality using jQuery, enhancing user experience and information accuracy.', "Demonstration of how to toggle the display of the billing address form using jQuery when the 'use default address' checkbox is selected, providing a visual indication to the user. Step-by-step guide on toggling the display of the billing address form based on checkbox selection, enhancing user understanding and experience."]}, {'end': 15537.157, 'start': 15289.006, 'title': 'User profile and payment processing', 'summary': 'Discusses the addition of a user profile model linked to a user with a one-to-one field, usage of post-save signal to create user profile at user creation, and the process of saving and processing card information for future purchases and one-click purchasing.', 'duration': 248.151, 'highlights': ['The chapter discusses the addition of a user profile model linked to a user with a one-to-one field. The user profile model is added, linked to a user with a one-to-one field, to store user information for future use.', 'Usage of post-save signal to create user profile at user creation. Post-save signal is used to create the user profile at the moment of user creation, ensuring that every user has their own user profile.', 'The process of saving and processing card information for future purchases and one-click purchasing. The chapter explains the process of saving and processing card information for future purchases, including the activation of one-click purchasing and storing the stripe customer ID.']}, {'end': 15731.178, 'start': 15537.478, 'title': 'Stripe customer card handling', 'summary': 'Covers the process of fetching and displaying user cards from stripe, including handling the addition of a new card, setting a default card, and processing successful orders through stripe, ensuring data security and improved user experience.', 'duration': 193.7, 'highlights': ['The process of fetching user cards from Stripe customer was explained, including the method call to stripe.customer.listSources and specifying the arguments such as customer ID and object type.', 'The demonstration of updating the context to have a card if the list of cards is greater than zero, and outputting the card details in the HTML template, ensuring a seamless user experience.', 'The implementation of saving a default payment method by storing a default credit card in the form, allowing users to select a default card for future purchases, and ensuring successful order processing through Stripe.']}], 'duration': 1332.541, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/YZvRrldjf1Y/pics/YZvRrldjf1Y14398637.jpg', 'highlights': ['Demonstration of updating the context to have a card if the list of cards is greater than zero, and outputting the card details in the HTML template, ensuring a seamless user experience.', 'The implementation of saving a default payment method by storing a default credit card in the form, allowing users to select a default card for future purchases, and ensuring successful order processing through Stripe.', 'The process of saving and processing card information for future purchases, including the activation of one-click purchasing and storing the stripe customer ID.', 'The process of fetching user cards from Stripe customer was explained, including the method call to stripe.customer.listSources and specifying the arguments such as customer ID and object type.']}], 'highlights': ['The process of calculating the amount saved for an item is demonstrated, resulting in a $300 saving for a specific item.', 'Creating an order summary view Includes creating a detail view for the order summary, setting the foundation for displaying cart items and managing quantities.', 'The chapter discusses updating order items by adding conditions to prevent duplicate entries', 'The chapter covers the implementation of order processing, including handling post requests, saving billing addresses, and redirecting users based on the selected payment option.', 'The chapter focuses on adding discount codes to the checkout process.', 'The workflow for processing e-commerce orders involves steps for delivery, tracking, and refunds, with the addition of statuses being delivered, received, refund requested, and refund granted.', 'The process involves updating an address form by adding checkboxes for same billing address, default shipping address, and default billing address using jQuery and Django, and ensuring that the checkboxes are only displayed if there is a default address.']}