title
Django (2.0): An Introduction for Beginners
description
Learn Django in this video by following along as I show you how to build a simple hello world app and then a guestbook app that uses the templates, models, and form functionality with Django. Django is a huge library, so this video doesn't cover everything, but if you're new to Django or want to see how Django v2.0 is different, check this video out.
Need one-on-one help with your project? I can help through my coaching program. Learn more here: https://prettyprinted.com/coaching
Download the Django cheat sheet here: https://prettyprinted.com/django
Get the code and here: https://github.com/PrettyPrinted/intro_to_django
Twitter: https://twitter.com/pretty_printed
Github: https://github.com/prettyprinted
detail
{'title': 'Django (2.0): An Introduction for Beginners', 'heatmap': [{'end': 316.123, 'start': 274.175, 'weight': 0.828}, {'end': 676.881, 'start': 588.423, 'weight': 0.724}, {'end': 1064.98, 'start': 1023.013, 'weight': 0.782}, {'end': 1262.255, 'start': 1220.165, 'weight': 0.858}, {'end': 1341.433, 'start': 1298.401, 'weight': 0.761}, {'end': 1464.357, 'start': 1378.905, 'weight': 0.874}, {'end': 1695.846, 'start': 1608.15, 'weight': 0.755}, {'end': 1818.44, 'start': 1732.351, 'weight': 0.705}, {'end': 2174.273, 'start': 1892.552, 'weight': 0.805}, {'end': 2645.238, 'start': 2597.49, 'weight': 0.851}, {'end': 2724.592, 'start': 2677.393, 'weight': 0.729}, {'end': 3352.267, 'start': 3271.02, 'weight': 1}], 'summary': 'Provides a comprehensive introduction to django web framework, covering topics such as django 2.0 deployment, admin setup, app creation, url routing, organizing apps, dynamic templates, and database model creation. it emphasizes the advantages of django over micro frameworks, showcases the creation of a simple guestbook application, and offers practical demonstrations and resources like cheat sheets and reference code.', 'chapters': [{'end': 68.76, 'segs': [{'end': 33.248, 'src': 'embed', 'start': 1.101, 'weight': 0, 'content': [{'end': 2.662, 'text': "Hey everyone, it's Anthony from PrettyPrinting here.", 'start': 1.101, 'duration': 1.561}, {'end': 7.023, 'text': "In today's video, I'll be introducing you to the Django web framework for Python.", 'start': 3.022, 'duration': 4.001}, {'end': 13.485, 'text': "And while I introduce you to this framework, I'll show you how to build a very simple guestbook application using Django.", 'start': 7.363, 'duration': 6.122}, {'end': 19.267, 'text': 'So, to understand this tutorial, you just need to know a little bit of Python and HTML,', 'start': 14.265, 'duration': 5.002}, {'end': 21.808, 'text': 'and that should be enough for you to follow along with the tutorial.', 'start': 19.267, 'duration': 2.541}, {'end': 27.73, 'text': "If you have any questions, of course, like you get stuck with something, then just leave a comment down below and I'll help you out.", 'start': 22.528, 'duration': 5.202}, {'end': 33.248, 'text': 'Another thing you should know is I have created some resources for this video that you can download.', 'start': 28.624, 'duration': 4.624}], 'summary': 'Intro to django web framework for python, building a guestbook app, requires basic python and html knowledge.', 'duration': 32.147, 'max_score': 1.101, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81101.jpg'}, {'end': 59.109, 'src': 'embed', 'start': 33.628, 'weight': 1, 'content': [{'end': 41.895, 'text': "So just go down to the links in the description below and you'll see how you can download a Django cheat sheet which you can reference while developing your Django apps.", 'start': 33.628, 'duration': 8.267}, {'end': 47.46, 'text': "And also I have a link to the actual demo for what I'm going to create in this video,", 'start': 42.255, 'duration': 5.205}, {'end': 51.423, 'text': 'so you can see it running and kind of compare what you build to what I built.', 'start': 47.46, 'duration': 3.963}, {'end': 59.109, 'text': "And finally, there will be a link to the code, so you can look at my code and compare it to the code that you've written,", 'start': 52.123, 'duration': 6.986}], 'summary': 'Access a django cheat sheet, demo, and code for comparison.', 'duration': 25.481, 'max_score': 33.628, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ833628.jpg'}], 'start': 1.101, 'title': 'Django web framework', 'summary': 'Provides an introduction to the django web framework for python and showcases the creation of a simple guestbook application using django. it includes resources like a django cheat sheet, demo, and reference code.', 'chapters': [{'end': 68.76, 'start': 1.101, 'title': 'Introduction to django web framework', 'summary': 'Introduces the django web framework for python and demonstrates building a simple guestbook application using django, with resources such as a django cheat sheet, demo, and code provided for reference.', 'duration': 67.659, 'highlights': ['The chapter introduces the Django web framework for Python and demonstrates building a simple guestbook application using Django. Anthony introduces the Django web framework for Python and demonstrates building a simple guestbook application using Django.', 'Resources such as a Django cheat sheet, demo, and code are provided for reference. Anthony provides resources including a Django cheat sheet, demo, and code for reference.', 'Audience only needs to know a little bit of Python and HTML to follow the tutorial. Audience only needs a basic understanding of Python and HTML to follow the tutorial.']}], 'duration': 67.659, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81101.jpg', 'highlights': ['The chapter introduces the Django web framework for Python and demonstrates building a simple guestbook application using Django.', 'Resources such as a Django cheat sheet, demo, and code are provided for reference.', 'Audience only needs a basic understanding of Python and HTML to follow the tutorial.']}, {'end': 495.923, 'segs': [{'end': 100.994, 'src': 'embed', 'start': 70.58, 'weight': 0, 'content': [{'end': 77.89, 'text': "Okay, so before I get into installing Django and actually creating a Django app, what I'll talk about first is an overview of Django.", 'start': 70.58, 'duration': 7.31}, {'end': 81.896, 'text': 'So Django is a high level web framework for Python.', 'start': 78.231, 'duration': 3.665}, {'end': 86.422, 'text': 'So a web framework is just a way to create web apps in a particular programming language.', 'start': 81.996, 'duration': 4.426}, {'end': 90.566, 'text': 'So usually the apps you create can only start off as scripts.', 'start': 86.923, 'duration': 3.643}, {'end': 92.247, 'text': 'But if you add in a web framework,', 'start': 90.826, 'duration': 1.421}, {'end': 100.994, 'text': 'then you can create a web app so people can use their browsers or some tool that can perform HTTP requests and get something returned from it,', 'start': 92.247, 'duration': 8.747}], 'summary': 'Django is a high-level web framework for python, enabling web app creation with http requests.', 'duration': 30.414, 'max_score': 70.58, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ870580.jpg'}, {'end': 196.573, 'src': 'embed', 'start': 161.9, 'weight': 1, 'content': [{'end': 168.923, 'text': 'But for a larger project, something like Django starts to work pretty well because it gives you a certain structure to start off with,', 'start': 161.9, 'duration': 7.023}, {'end': 170.343, 'text': "so it's easier to scale your code.", 'start': 168.923, 'duration': 1.42}, {'end': 176.046, 'text': "It's easier to understand for multiple developers because there is one convention that you're using.", 'start': 170.944, 'duration': 5.102}, {'end': 179.447, 'text': "It's not like you're making up the convention when you use something like Flask.", 'start': 176.386, 'duration': 3.061}, {'end': 188.05, 'text': "so it's easier for others to understand and because it comes with so many included components, you don't have to make decisions on what to use.", 'start': 179.847, 'duration': 8.203}, {'end': 194.032, 'text': "you don't have to make decisions on what libraries to include in your web app to make sure you can get certain features.", 'start': 188.05, 'duration': 5.982}, {'end': 196.573, 'text': 'django covers a lot of that already now.', 'start': 194.032, 'duration': 2.541}], 'summary': 'Django provides structure, scalability, and pre-included components, making it easier for multiple developers to understand and use.', 'duration': 34.673, 'max_score': 161.9, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ8161900.jpg'}, {'end': 281.696, 'src': 'embed', 'start': 253.009, 'weight': 5, 'content': [{'end': 256.63, 'text': "I have a virtual environment running as well, so it's the only thing in the virtual environment.", 'start': 253.009, 'duration': 3.621}, {'end': 258.391, 'text': 'That and its dependencies, of course.', 'start': 256.69, 'duration': 1.701}, {'end': 264.012, 'text': 'So once you have it installed, go to a directory where you want to create a project.', 'start': 258.991, 'duration': 5.021}, {'end': 267.913, 'text': 'So a project for Django is kind of the container for everything that you do.', 'start': 264.072, 'duration': 3.841}, {'end': 270.774, 'text': 'So I have this directory here called Django stuff.', 'start': 268.373, 'duration': 2.401}, {'end': 273.314, 'text': "And what I'm going to do is I'm going to create a project.", 'start': 271.174, 'duration': 2.14}, {'end': 281.696, 'text': "So to create a project, I'm going to run the command Django dash admin, start project, and then a project name.", 'start': 274.175, 'duration': 7.521}], 'summary': 'Setting up a project in django using a virtual environment.', 'duration': 28.687, 'max_score': 253.009, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ8253009.jpg'}, {'end': 316.123, 'src': 'heatmap', 'start': 274.175, 'weight': 0.828, 'content': [{'end': 281.696, 'text': "So to create a project, I'm going to run the command Django dash admin, start project, and then a project name.", 'start': 274.175, 'duration': 7.521}, {'end': 283.497, 'text': "So I'm going to name this my project.", 'start': 281.817, 'duration': 1.68}, {'end': 288.503, 'text': 'and if it returns with no errors, that means everything went well.', 'start': 285.24, 'duration': 3.263}, {'end': 292.686, 'text': 'If I look at my directory now, I have this directory called my project.', 'start': 288.723, 'duration': 3.963}, {'end': 298.491, 'text': 'So if I open up my project, I see another directory called my project and in a file called manage.', 'start': 293.086, 'duration': 5.405}, {'end': 307.299, 'text': "what I'll do is I'll load this into Sublime so it's easier to see the files and I'll go through what these files mean.", 'start': 299.816, 'duration': 7.483}, {'end': 316.123, 'text': "So the first file is manage.py and manage.py is what's going to allow us to run commands that are relevant to our Django project.", 'start': 307.82, 'duration': 8.303}], 'summary': "Creating a django project named 'my project' using 'django dash admin' command.", 'duration': 41.948, 'max_score': 274.175, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ8274175.jpg'}], 'start': 70.58, 'title': 'Django web framework', 'summary': 'Provides an overview of django, a high-level web framework for python, emphasizing its advantages over micro frameworks such as flask, express, and sinatra, and providing installation instructions and an overview of key project files.', 'chapters': [{'end': 115.973, 'start': 70.58, 'title': 'Overview of django web framework', 'summary': 'Provides an overview of django, a high level web framework for python, which allows for the creation of web apps using http requests and provides tools to simplify development.', 'duration': 45.393, 'highlights': ['Django is a high level web framework for Python, making it easier to develop web apps by providing more tools out of the box.', 'A web framework allows the creation of web apps in a specific programming language, enabling users to access websites or API results through HTTP requests.', 'Using a web framework such as Django, scripts can be developed into web apps for user interaction.']}, {'end': 495.923, 'start': 116.513, 'title': 'Choosing between django and micro frameworks', 'summary': 'Discusses the advantages of using django over micro frameworks such as flask, express, and sinatra, highlighting the structured project organization, included components, and simplified url routing. it also provides installation instructions and an overview of key project files and their functionalities.', 'duration': 379.41, 'highlights': ['Django provides a structured project organization, making it easier to scale code and understand for multiple developers. The structured project organization in Django simplifies scaling code and enhances understanding for multiple developers.', 'Django comes with many included components, reducing the need to make decisions on what libraries to include in the web app. The included components in Django reduce the need to make decisions on which libraries to include in the web app.', 'Django simplifies URL routing by eliminating the need to use regular expressions, making it more beginner-friendly. Django simplifies URL routing by eliminating the need to use regular expressions, making it more beginner-friendly.', 'The chapter also provides installation instructions for Django, including creating a project and an overview of key project files and their functionalities. The chapter also provides installation instructions for Django, including creating a project and an overview of key project files and their functionalities.']}], 'duration': 425.343, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ870580.jpg', 'highlights': ['Django is a high level web framework for Python, making it easier to develop web apps by providing more tools out of the box.', 'Django provides a structured project organization, making it easier to scale code and understand for multiple developers.', 'Using a web framework such as Django, scripts can be developed into web apps for user interaction.', 'Django comes with many included components, reducing the need to make decisions on what libraries to include in the web app.', 'Django simplifies URL routing by eliminating the need to use regular expressions, making it more beginner-friendly.', 'The chapter also provides installation instructions for Django, including creating a project and an overview of key project files and their functionalities.', 'A web framework allows the creation of web apps in a specific programming language, enabling users to access websites or API results through HTTP requests.']}, {'end': 845.263, 'segs': [{'end': 521.5, 'src': 'embed', 'start': 495.983, 'weight': 0, 'content': [{'end': 501.367, 'text': 'And especially in something like Django, where, if you have parameters that you can pass into a URL,', 'start': 495.983, 'duration': 5.384}, {'end': 504.509, 'text': 'regular expressions could get very complicated very fast.', 'start': 501.367, 'duration': 3.142}, {'end': 505.97, 'text': 'But now in 2.0,', 'start': 504.589, 'duration': 1.381}, {'end': 513.434, 'text': 'they simplified it so you can just pass in a string and then Django will match the string and then send the user to a certain part of the app.', 'start': 505.97, 'duration': 7.464}, {'end': 518.519, 'text': "And of course, I'll show you that in a moment, but that's it for URLs right now.", 'start': 513.495, 'duration': 5.024}, {'end': 521.5, 'text': "And I'm going to show you the admin in just a second.", 'start': 518.719, 'duration': 2.781}], 'summary': 'Django 2.0 simplifies url handling, making it easier to pass parameters and match strings.', 'duration': 25.517, 'max_score': 495.983, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ8495983.jpg'}, {'end': 616.541, 'src': 'embed', 'start': 588.423, 'weight': 1, 'content': [{'end': 595.391, 'text': "Since I didn't modify anything, you shouldn't have any problems getting to this screen at least because this works out of the box.", 'start': 588.423, 'duration': 6.968}, {'end': 600.016, 'text': 'Now what I want to do is I want to work with the admin dashboard.', 'start': 596.755, 'duration': 3.261}, {'end': 608.238, 'text': "So the first thing I need to do is I need to actually create the migration or it's created already.", 'start': 600.096, 'duration': 8.142}, {'end': 610.719, 'text': 'I need to migrate the things into the database.', 'start': 608.278, 'duration': 2.441}, {'end': 616.541, 'text': "So what I'm going to do is I'm going to type Python manage.py and then migrate.", 'start': 611.799, 'duration': 4.742}], 'summary': "The process works out of the box, and migration needs to be done using 'python manage.py migrate'.", 'duration': 28.118, 'max_score': 588.423, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ8588423.jpg'}, {'end': 676.881, 'src': 'heatmap', 'start': 588.423, 'weight': 0.724, 'content': [{'end': 595.391, 'text': "Since I didn't modify anything, you shouldn't have any problems getting to this screen at least because this works out of the box.", 'start': 588.423, 'duration': 6.968}, {'end': 600.016, 'text': 'Now what I want to do is I want to work with the admin dashboard.', 'start': 596.755, 'duration': 3.261}, {'end': 608.238, 'text': "So the first thing I need to do is I need to actually create the migration or it's created already.", 'start': 600.096, 'duration': 8.142}, {'end': 610.719, 'text': 'I need to migrate the things into the database.', 'start': 608.278, 'duration': 2.441}, {'end': 616.541, 'text': "So what I'm going to do is I'm going to type Python manage.py and then migrate.", 'start': 611.799, 'duration': 4.742}, {'end': 622.922, 'text': "And what this is going to do is it's going to create a bunch of tables in my database.", 'start': 617.801, 'duration': 5.121}, {'end': 628.594, 'text': "So what I'll do is I'll open up the SQLite database that gets generated.", 'start': 623.323, 'duration': 5.271}, {'end': 629.535, 'text': 'So first let me show you.', 'start': 628.634, 'duration': 0.901}, {'end': 635.159, 'text': 'Here on the left-hand side of the projects, you see this db.sqlite3 has been created.', 'start': 630.055, 'duration': 5.104}, {'end': 641.363, 'text': 'Once I run migrate, it looks at the databases, it sees what database I want to use.', 'start': 635.799, 'duration': 5.564}, {'end': 642.944, 'text': "In this particular case, it's SQLite.", 'start': 641.383, 'duration': 1.561}, {'end': 650.109, 'text': 'So it creates that database and then it adds the migrations to it, which means it just creates the tables in the database.', 'start': 643.324, 'duration': 6.785}, {'end': 655.812, 'text': "So I have a viewer for the database on my other screen that I'm just opening right now.", 'start': 650.509, 'duration': 5.303}, {'end': 657.994, 'text': 'So now let me move it over.', 'start': 656.993, 'duration': 1.001}, {'end': 661.955, 'text': 'This is just a GUI for a SQLite database.', 'start': 658.014, 'duration': 3.941}, {'end': 663.035, 'text': 'You can use another one.', 'start': 662.075, 'duration': 0.96}, {'end': 667.497, 'text': "If you're using something like MySQL or Postgres, then you'd have another thing.", 'start': 663.156, 'duration': 4.341}, {'end': 676.881, 'text': "But basically all I'm using this for is just to show you how I have different tables to begin with, even though I haven't done anything in my project.", 'start': 667.637, 'duration': 9.244}], 'summary': 'Creating and migrating tables into sqlite database for admin dashboard setup.', 'duration': 88.458, 'max_score': 588.423, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ8588423.jpg'}, {'end': 826.634, 'src': 'embed', 'start': 793.712, 'weight': 2, 'content': [{'end': 796.674, 'text': "I don't see the migrations there anymore because I applied them.", 'start': 793.712, 'duration': 2.962}, {'end': 805.139, 'text': 'If I refresh and type in my username and then a password, I get logged in.', 'start': 797.134, 'duration': 8.005}, {'end': 809.081, 'text': 'So this is the Django admin screen.', 'start': 805.719, 'duration': 3.362}, {'end': 813.344, 'text': 'And before I get into anything else, just know that this is responsive now.', 'start': 809.422, 'duration': 3.922}, {'end': 815.926, 'text': 'So in 2.0, they made this responsive.', 'start': 813.684, 'duration': 2.242}, {'end': 819.268, 'text': 'So you see how it all squishes together as I make things a little smaller.', 'start': 815.946, 'duration': 3.322}, {'end': 826.634, 'text': 'I actually have an example of the old one So this is from Django 1.10, I believe.', 'start': 819.788, 'duration': 6.846}], 'summary': 'Django admin screen is now responsive in 2.0, unlike the old version from 1.10.', 'duration': 32.922, 'max_score': 793.712, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ8793712.jpg'}], 'start': 495.983, 'title': 'Django 2.0 deployment and admin setup', 'summary': 'Covers the simplified url parameter passing, admin dashboard setup, and responsive design update in django 2.0, along with web app deployment and superuser creation.', 'chapters': [{'end': 845.263, 'start': 495.983, 'title': 'Django 2.0 deployment and admin setup', 'summary': 'Covers the simplified url parameter passing in django 2.0, the process of setting up the admin dashboard, and the responsive design update in version 2.0, all while deploying a web app and creating a superuser with detailed technical steps.', 'duration': 349.28, 'highlights': ['Django 2.0 simplifies URL parameter passing by allowing the direct passing of a string, making it easier to match and direct users within the app. Django 2.0 simplifies URL parameter passing by allowing the direct passing of a string, streamlining the process and improving user navigation.', 'The process of setting up the admin dashboard involves creating migrations, opening and verifying the SQLite database, creating a superuser, and accessing the responsive Django 2.0 admin screen. The process of setting up the admin dashboard involves creating migrations, opening and verifying the SQLite database, creating a superuser, and accessing the responsive Django 2.0 admin screen, demonstrating the comprehensive setup process.', 'Django 2.0 admin dashboard is now responsive, a notable improvement from the non-responsive design in previous versions, enhancing user experience and adaptability across devices. Django 2.0 admin dashboard is now responsive, a notable improvement from the non-responsive design in previous versions, enhancing user experience and adaptability across devices.']}], 'duration': 349.28, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ8495983.jpg', 'highlights': ['Django 2.0 simplifies URL parameter passing by allowing the direct passing of a string, making it easier to match and direct users within the app.', 'The process of setting up the admin dashboard involves creating migrations, opening and verifying the SQLite database, creating a superuser, and accessing the responsive Django 2.0 admin screen, demonstrating the comprehensive setup process.', 'Django 2.0 admin dashboard is now responsive, a notable improvement from the non-responsive design in previous versions, enhancing user experience and adaptability across devices.']}, {'end': 1207.617, 'segs': [{'end': 876.782, 'src': 'embed', 'start': 845.664, 'weight': 0, 'content': [{'end': 851.391, 'text': 'And now if I look at users, I see my user, Anthony, email address, anthony.prettyprinter.com.', 'start': 845.664, 'duration': 5.727}, {'end': 853.674, 'text': 'And if I go back, I see groups.', 'start': 851.771, 'duration': 1.903}, {'end': 855.536, 'text': "There's no groups because I haven't added any.", 'start': 853.734, 'duration': 1.802}, {'end': 862.324, 'text': 'But these two tables are what I get in the beginning without having any new code in the project.', 'start': 855.836, 'duration': 6.488}, {'end': 868.973, 'text': "this is all the default django stuff, so i'll get back to the admin dashboard later when i'm working on the guestbook app,", 'start': 862.324, 'duration': 6.649}, {'end': 876.782, 'text': 'but just know that this is a really nice place for us to interface with our models directly, so i can make changes here and update the database,', 'start': 868.973, 'duration': 7.809}], 'summary': 'Default django admin dashboard displays user info and groups.', 'duration': 31.118, 'max_score': 845.664, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ8845664.jpg'}, {'end': 908.584, 'src': 'embed', 'start': 886.331, 'weight': 1, 'content': [{'end': 894.478, 'text': "So if you were creating, let's say, a blog app, you wouldn't have to create a section where an author can type in a blog post and post it.", 'start': 886.331, 'duration': 8.147}, {'end': 896.299, 'text': 'They can just use the admin dashboard.', 'start': 894.538, 'duration': 1.761}, {'end': 900.183, 'text': 'And you can restrict their permissions in such a way that they can only add blog posts.', 'start': 896.58, 'duration': 3.603}, {'end': 902.505, 'text': "They can't do something like change the name of the blog.", 'start': 900.203, 'duration': 2.302}, {'end': 906.096, 'text': "So whatever you want here, it's nice because it's right out of the box.", 'start': 902.966, 'duration': 3.13}, {'end': 908.584, 'text': "You don't have to do anything extra to get this.", 'start': 906.116, 'duration': 2.468}], 'summary': 'Admin dashboard allows authors to add blog posts, restrict permissions, and make changes without extra effort.', 'duration': 22.253, 'max_score': 886.331, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ8886331.jpg'}, {'end': 957.052, 'src': 'embed', 'start': 931.998, 'weight': 2, 'content': [{'end': 938.882, 'text': 'But in Django, an app is actually considered a component of what we view as a web app.', 'start': 931.998, 'duration': 6.884}, {'end': 945.585, 'text': 'So, to give you an example, you can go to one site and this one site will have a store, it will have a blog,', 'start': 939.742, 'duration': 5.843}, {'end': 947.807, 'text': 'it will have a form and it will have a contact form.', 'start': 945.585, 'duration': 2.222}, {'end': 954.81, 'text': 'You can view all four of those things as being part of the same web app or in Django you can view them as separate components.', 'start': 948.327, 'duration': 6.483}, {'end': 957.052, 'text': 'So you can view the blog as standalone.', 'start': 955.211, 'duration': 1.841}], 'summary': 'In django, apps are considered separate components of a web app, e.g., store, blog, form, and contact form.', 'duration': 25.054, 'max_score': 931.998, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ8931998.jpg'}, {'end': 1064.98, 'src': 'heatmap', 'start': 1023.013, 'weight': 0.782, 'content': [{'end': 1027.137, 'text': 'And if you looked on the left hand side, you see it added hello as a directory.', 'start': 1023.013, 'duration': 4.124}, {'end': 1032.845, 'text': 'So if I open that, I have a migrations folder, which will hold any future migrations.', 'start': 1027.858, 'duration': 4.987}, {'end': 1036.509, 'text': "At the moment, there's nothing in it except for init.py, which is empty.", 'start': 1032.905, 'duration': 3.604}, {'end': 1039.373, 'text': "And then there's another init.py, empty as well.", 'start': 1037.01, 'duration': 2.363}, {'end': 1046.127, 'text': 'admin. this allows you to register models so you can see them on the admin dashboard that i just showed you.', 'start': 1040.742, 'duration': 5.385}, {'end': 1048.809, 'text': "so we'll get to this during the guestbook application.", 'start': 1046.127, 'duration': 2.682}, {'end': 1051.931, 'text': "but for the hello world one we won't need that.", 'start': 1048.809, 'duration': 3.122}, {'end': 1057.455, 'text': 'apps. allows you to change some configuration about your apps models.', 'start': 1051.931, 'duration': 5.524}, {'end': 1064.98, 'text': 'allows you to add models for your database to map you know python code to actual tables in the database.', 'start': 1057.455, 'duration': 7.525}], 'summary': "The left side shows a new directory 'hello' with empty init files, and admin and apps functionalities for managing models and database mapping.", 'duration': 41.967, 'max_score': 1023.013, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81023013.jpg'}, {'end': 1164.841, 'src': 'embed', 'start': 1138.644, 'weight': 4, 'content': [{'end': 1142.686, 'text': 'So from Django dot HTTP is what I need to import from.', 'start': 1138.644, 'duration': 4.042}, {'end': 1145.247, 'text': "I'm going to import HTTP response.", 'start': 1142.766, 'duration': 2.481}, {'end': 1151.349, 'text': 'And this allows us to create a response that gets returned after someone accesses a certain endpoint.', 'start': 1145.347, 'duration': 6.002}, {'end': 1154.43, 'text': "So I'm going to call this index.", 'start': 1152.071, 'duration': 2.359}, {'end': 1160.937, 'text': 'For every view function that you have, it needs to pass in the request.', 'start': 1156.594, 'duration': 4.343}, {'end': 1164.841, 'text': 'It needs to have a parameter called request and Django will automatically pass that in there.', 'start': 1161.057, 'duration': 3.784}], 'summary': 'Import django http response to create endpoint responses.', 'duration': 26.197, 'max_score': 1138.644, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81138644.jpg'}], 'start': 845.664, 'title': 'Django admin interface, app creation, and django app creation', 'summary': "Discusses the default functionality of django admin dashboard, its significance in interfacing with models directly, and creating separate components within a web app using django. additionally, it explains how to create a django app, highlighting the ease of moving parts between web apps and demonstrating the creation of a simple 'hello world' app using django, including the process of importing http response, creating view functions, and returning a response to the browser.", 'chapters': [{'end': 974.084, 'start': 845.664, 'title': 'Django admin interface and app creation', 'summary': "Discusses the django admin dashboard's default functionality, its significance in interfacing with models directly, and the concept of creating separate components within a web app using django, showcasing its self-contained nature.", 'duration': 128.42, 'highlights': ['The default Django admin dashboard provides tables for users and groups without additional code, enabling direct interface with models and database updates. The admin dashboard offers default tables for users and groups, allowing direct model interface and database updates without extra backend admin screens.', 'The admin dashboard serves as a convenient interface for making changes and updating the database, eliminating the need to create backend admin screens for apps. The admin dashboard acts as a convenient interface for making changes and updating the database, eliminating the necessity of creating backend admin screens for apps.', "In Django, an 'app' is considered a component rather than the final product, allowing the creation of separate components within a web app, each self-contained and standalone. Django views an 'app' as a component within a web app, enabling the creation of separate, self-contained components within the web app."]}, {'end': 1207.617, 'start': 974.164, 'title': 'Creating a django app', 'summary': "Discusses how to create a django app, explaining the ease of moving parts between web apps and demonstrating the creation of a simple 'hello world' app using django, including the process of importing http response, creating view functions, and returning a response to the browser.", 'duration': 233.453, 'highlights': ["The chapter discusses the ease of moving parts between web apps and demonstrates the creation of a simple 'hello world' app using Django. The speaker explains that if two web apps are similar, one can easily move parts from one app to another, illustrating this with the example of using the same forum app for different projects to achieve the same result.", "The process of creating a 'hello world' app using Django is demonstrated, including the steps of importing HTTP response, creating view functions, and returning a response to the browser. The speaker walks through the process of creating a 'hello world' app in Django, including importing HTTP response, creating a view function named 'index' that returns a simple 'hello world' text as an HTTP response, and explaining the conventions of passing the request parameter in the view function."]}], 'duration': 361.953, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ8845664.jpg', 'highlights': ['The default Django admin dashboard provides tables for users and groups without additional code, enabling direct interface with models and database updates.', 'The admin dashboard serves as a convenient interface for making changes and updating the database, eliminating the need to create backend admin screens for apps.', "In Django, an 'app' is considered a component rather than the final product, allowing the creation of separate components within a web app, each self-contained and standalone.", "The chapter discusses the ease of moving parts between web apps and demonstrates the creation of a simple 'hello world' app using Django.", "The process of creating a 'hello world' app using Django is demonstrated, including the steps of importing HTTP response, creating view functions, and returning a response to the browser."]}, {'end': 1551.397, 'segs': [{'end': 1262.255, 'src': 'heatmap', 'start': 1208.097, 'weight': 0, 'content': [{'end': 1210.219, 'text': "But like I said, in this case, we're going to keep it simple.", 'start': 1208.097, 'duration': 2.122}, {'end': 1214.682, 'text': 'So just a response, a HTTP response that says hello world.', 'start': 1210.279, 'duration': 4.403}, {'end': 1219.965, 'text': 'So now that I have that, what I need to do is I need to create another urls.py file.', 'start': 1215.702, 'duration': 4.263}, {'end': 1225.289, 'text': "And instead of the urls.py file in my project, I'm going to put it in hello.", 'start': 1220.165, 'duration': 5.124}, {'end': 1230.272, 'text': 'So call this urls.py.', 'start': 1225.829, 'duration': 4.443}, {'end': 1238.035, 'text': "And what I'm going to do in this urls.py is first I'm going to import path like I have here.", 'start': 1232.13, 'duration': 5.905}, {'end': 1243.079, 'text': "So let me just copy and paste that because it's pretty much the same process when it comes to that.", 'start': 1238.315, 'duration': 4.764}, {'end': 1245.862, 'text': 'Then I also want to import the views that I have.', 'start': 1243.48, 'duration': 2.382}, {'end': 1253.328, 'text': 'So from period, so from the same package, import views.', 'start': 1247.343, 'duration': 5.985}, {'end': 1256.811, 'text': "So that's just loading everything from this file.", 'start': 1253.748, 'duration': 3.063}, {'end': 1260.412, 'text': "I'm going to use the URL patterns.", 'start': 1258.769, 'duration': 1.643}, {'end': 1262.255, 'text': "So it's going to be just like this.", 'start': 1260.933, 'duration': 1.322}], 'summary': 'Creating a simple http response, importing path and views for url patterns.', 'duration': 52.315, 'max_score': 1208.097, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81208097.jpg'}, {'end': 1341.433, 'src': 'heatmap', 'start': 1298.401, 'weight': 0.761, 'content': [{'end': 1305.184, 'text': 'So the second thing I pass is views dot index and then I can also give this a name so it can be referenced later elsewhere in the code.', 'start': 1298.401, 'duration': 6.783}, {'end': 1306.865, 'text': "So I'll just call this index.", 'start': 1305.224, 'duration': 1.641}, {'end': 1313.008, 'text': 'So what this is going to do is, anytime hello gets matched from the request,', 'start': 1308.246, 'duration': 4.762}, {'end': 1321.752, 'text': 'it is going to send that request to views dot index and then that request will get loaded here and then the response will be returned once this is done,', 'start': 1313.008, 'duration': 8.744}, {'end': 1322.212, 'text': 'executing.', 'start': 1321.752, 'duration': 0.46}, {'end': 1324.98, 'text': "So I'll save that.", 'start': 1323.999, 'duration': 0.981}, {'end': 1327.462, 'text': "And now I'll go over to this URL.", 'start': 1325.4, 'duration': 2.062}, {'end': 1329.504, 'text': 'So this is the URLs for my project.', 'start': 1327.502, 'duration': 2.002}, {'end': 1331.465, 'text': "So it's kind of like the main URLs file.", 'start': 1329.584, 'duration': 1.881}, {'end': 1335.228, 'text': 'So it starts here and it starts looking for things here.', 'start': 1331.505, 'duration': 3.723}, {'end': 1341.433, 'text': 'And then it goes to the URLs that I specify in my individual apps.', 'start': 1335.668, 'duration': 5.765}], 'summary': 'Passing views dot index will send matched request to views dot index.', 'duration': 43.032, 'max_score': 1298.401, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81298401.jpg'}, {'end': 1335.228, 'src': 'embed', 'start': 1313.008, 'weight': 5, 'content': [{'end': 1321.752, 'text': 'it is going to send that request to views dot index and then that request will get loaded here and then the response will be returned once this is done,', 'start': 1313.008, 'duration': 8.744}, {'end': 1322.212, 'text': 'executing.', 'start': 1321.752, 'duration': 0.46}, {'end': 1324.98, 'text': "So I'll save that.", 'start': 1323.999, 'duration': 0.981}, {'end': 1327.462, 'text': "And now I'll go over to this URL.", 'start': 1325.4, 'duration': 2.062}, {'end': 1329.504, 'text': 'So this is the URLs for my project.', 'start': 1327.502, 'duration': 2.002}, {'end': 1331.465, 'text': "So it's kind of like the main URLs file.", 'start': 1329.584, 'duration': 1.881}, {'end': 1335.228, 'text': 'So it starts here and it starts looking for things here.', 'start': 1331.505, 'duration': 3.723}], 'summary': "Transcript describes sending a request to 'views.index', then loading the response and accessing project urls.", 'duration': 22.22, 'max_score': 1313.008, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81313008.jpg'}, {'end': 1464.357, 'src': 'heatmap', 'start': 1378.905, 'weight': 0.874, 'content': [{'end': 1383.667, 'text': 'So once I have those two things, I can run the app and see what happens when I go to Hello.', 'start': 1378.905, 'duration': 4.762}, {'end': 1392.09, 'text': "So just so you know what happens here is it's going to be checking to see if something that I typed into the browser has either admin or blank.", 'start': 1383.947, 'duration': 8.143}, {'end': 1395.751, 'text': 'Pass admin is going to send me to the admin dashboard.', 'start': 1392.43, 'duration': 3.321}, {'end': 1398.952, 'text': "If it's blank, it's going to send me to hello.urls.", 'start': 1396.091, 'duration': 2.861}, {'end': 1404.715, 'text': "Then it's going to open up the urls for hello and then it's going to do the same process.", 'start': 1399.492, 'duration': 5.223}, {'end': 1406.717, 'text': "so then it's going to be looking for hello.", 'start': 1404.715, 'duration': 2.002}, {'end': 1410.979, 'text': "if it finds hello, it's going to match and send you to views.index.", 'start': 1406.717, 'duration': 4.262}, {'end': 1413.561, 'text': "if it doesn't find hello, then it will start complaining.", 'start': 1410.979, 'duration': 2.582}, {'end': 1418.885, 'text': 'so if i go to manage.py run server, we can test this out.', 'start': 1413.561, 'duration': 5.324}, {'end': 1424.204, 'text': 'So if I take away the admin and just go to the index,', 'start': 1421.081, 'duration': 3.123}, {'end': 1430.29, 'text': "I get an error because it's telling me that there are only two URLs possible in my app admin and hello.", 'start': 1424.204, 'duration': 6.086}, {'end': 1434.534, 'text': "And since I didn't supply either one of those, it's giving me a 404.", 'start': 1430.41, 'duration': 4.124}, {'end': 1439.779, 'text': 'But if I go to slash hello, I see the hello world that I typed in.', 'start': 1434.534, 'duration': 5.245}, {'end': 1447.528, 'text': 'So now we know that Django knows how to send the users whenever they go to slash hello.', 'start': 1440.942, 'duration': 6.586}, {'end': 1449.49, 'text': 'And I could do this in reverse.', 'start': 1448.089, 'duration': 1.401}, {'end': 1454.235, 'text': 'I can do something like make this blink and then I can make this hello.', 'start': 1449.59, 'duration': 4.645}, {'end': 1457.298, 'text': 'And it will do the same thing.', 'start': 1456.337, 'duration': 0.961}, {'end': 1464.357, 'text': 'So if I change that and save, the server actually starts by itself.', 'start': 1459.395, 'duration': 4.962}], 'summary': 'Testing app routes with admin and hello urls, verifying functionality with manage.py run server.', 'duration': 85.452, 'max_score': 1378.905, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81378905.jpg'}, {'end': 1524.136, 'src': 'embed', 'start': 1495.82, 'weight': 4, 'content': [{'end': 1498.363, 'text': 'So if I just go to hello again, I get hello world.', 'start': 1495.82, 'duration': 2.543}, {'end': 1504.31, 'text': "So that's one of the funny things about automatically reloading the server.", 'start': 1498.783, 'duration': 5.527}, {'end': 1506.17, 'text': "Sometimes it works, sometimes it doesn't.", 'start': 1504.43, 'duration': 1.74}, {'end': 1512.132, 'text': "So, if you are pretty confident in the change you made but it doesn't work, try restarting the server manually,", 'start': 1506.87, 'duration': 5.262}, {'end': 1514.273, 'text': 'because that happens all the time and it can be a little annoying.', 'start': 1512.132, 'duration': 2.141}, {'end': 1518.534, 'text': "You don't want to be in a situation where you make a change and the server restarts,", 'start': 1514.573, 'duration': 3.961}, {'end': 1524.136, 'text': "but you don't see that change reflected and you believe that the server picked it up and you go and try to debug your code,", 'start': 1518.534, 'duration': 5.602}], 'summary': 'Server auto-reloading can be unreliable, manual restart may be necessary for changes to take effect.', 'duration': 28.316, 'max_score': 1495.82, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81495820.jpg'}], 'start': 1208.097, 'title': 'Django url routing', 'summary': "Covers creating a new urls.py file for the 'hello' app, importing path and views, and setting the url pattern for the 'hello' response in django. it also explains the process of url routing in django, including how to include urls from different apps, match requests based on the specified urls, and troubleshoot automatic server reloading issues.", 'chapters': [{'end': 1286.783, 'start': 1208.097, 'title': "Creating a django url for 'hello' response", 'summary': "Covers creating a new urls.py file for the 'hello' app, importing path and views, and setting the url pattern for the 'hello' response in django.", 'duration': 78.686, 'highlights': ["Creating a new urls.py file for the 'hello' app", 'Importing path and views for setting the URL pattern', "Setting the URL pattern for the 'hello' response in Django"]}, {'end': 1551.397, 'start': 1286.883, 'title': 'Django url routing', 'summary': 'Explains the process of url routing in django, including how to include urls from different apps, match requests based on the specified urls, and troubleshoot automatic server reloading issues.', 'duration': 264.514, 'highlights': ["Explaining the process of including URLs from a different app in Django and how to match requests based on the specified URLs The chapter discusses including URLs from a different app in Django using the 'include' function, and how requests are matched based on the specified URLs, such as 'hello', and directed to the corresponding views.", 'Troubleshooting automatic server reloading issues and the importance of manually restarting the server to ensure changes are reflected The chapter emphasizes the importance of manually restarting the server to ensure changes are reflected, especially when dealing with templates and static files, and highlights the potential issues with automatic server reloading.', "Demonstrating the process of testing URL routing and resolving 404 errors by supplying the correct URLs The chapter demonstrates the process of testing URL routing and resolving 404 errors by supplying the correct URLs, such as 'hello', to successfully navigate to the corresponding views."]}], 'duration': 343.3, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81208097.jpg', 'highlights': ["Creating a new urls.py file for the 'hello' app", 'Importing path and views for setting the URL pattern', "Setting the URL pattern for the 'hello' response in Django", 'Explaining the process of including URLs from a different app in Django and how to match requests based on the specified URLs', 'Troubleshooting automatic server reloading issues and the importance of manually restarting the server to ensure changes are reflected', 'Demonstrating the process of testing URL routing and resolving 404 errors by supplying the correct URLs']}, {'end': 2336.541, 'segs': [{'end': 1580.678, 'src': 'embed', 'start': 1553.018, 'weight': 6, 'content': [{'end': 1560.985, 'text': 'So, generally speaking, you want to give the path here in the URLs for your my project a unique name, but it can also be the index.', 'start': 1553.018, 'duration': 7.967}, {'end': 1563.247, 'text': 'It just depends on how you want to organize your app.', 'start': 1561.045, 'duration': 2.202}, {'end': 1565.629, 'text': "It's not too important.", 'start': 1564.188, 'duration': 1.441}, {'end': 1569.252, 'text': 'You just have to pick a method of organizing the app.', 'start': 1565.709, 'duration': 3.543}, {'end': 1570.052, 'text': 'you can do it either way.', 'start': 1569.252, 'duration': 0.8}, {'end': 1580.678, 'text': 'you can make this the index and then you know at the path here, or you can make this the index and add um the path here and just know for future apps.', 'start': 1570.052, 'duration': 10.626}], 'summary': 'When organizing your app, give the urls a unique name or use the index, depending on your preference.', 'duration': 27.66, 'max_score': 1553.018, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81553018.jpg'}, {'end': 1695.846, 'src': 'heatmap', 'start': 1593.845, 'weight': 0, 'content': [{'end': 1600.967, 'text': "and next what I'll do is I'll get into how to create the guest book app, which is a much more interesting app to make in Django.", 'start': 1593.845, 'duration': 7.122}, {'end': 1607.65, 'text': "OK, so now let's start by creating a more interesting app.", 'start': 1603.508, 'duration': 4.142}, {'end': 1616.933, 'text': "So what I'm going to do here is I'm going to type Python manage.pie start app and then we'll call this guess book.", 'start': 1608.15, 'duration': 8.783}, {'end': 1623.202, 'text': "So once that happens, we'll see that I have a new directory called guestbook here.", 'start': 1618.638, 'duration': 4.564}, {'end': 1624.983, 'text': "So I'm going to be working on that.", 'start': 1623.622, 'duration': 1.361}, {'end': 1629.767, 'text': 'And before I forget, let me go to settings and add guestbook to installed apps.', 'start': 1625.363, 'duration': 4.404}, {'end': 1636.051, 'text': "So if I put guestbook here, that's going to allow Django to find certain things about the guestbook in our directory.", 'start': 1630.267, 'duration': 5.784}, {'end': 1641.335, 'text': "I didn't have to use it with hello because I was using it in a very straightforward way with just a single URL.", 'start': 1636.472, 'duration': 4.863}, {'end': 1648.701, 'text': "but for anything more complicated, like to use templates or static files, you'll need the installed app here.", 'start': 1642.136, 'duration': 6.565}, {'end': 1655.306, 'text': "so i'm adding guestbook here and then i just added hello there for consistency purposes.", 'start': 1648.701, 'duration': 6.605}, {'end': 1660.449, 'text': "but, like i said, we obviously don't need hello because i was able to use it without it.", 'start': 1655.306, 'duration': 5.143}, {'end': 1664.332, 'text': "so now i'll go back to my guestbook and it has created pretty much the same files.", 'start': 1660.449, 'duration': 3.883}, {'end': 1669.677, 'text': 'And what I want to do with the guestbook is I have some HTML here.', 'start': 1665.793, 'duration': 3.884}, {'end': 1670.738, 'text': 'So let me open this up.', 'start': 1669.817, 'duration': 0.921}, {'end': 1672.339, 'text': 'So I have two files.', 'start': 1671.418, 'duration': 0.921}, {'end': 1678.745, 'text': 'I have a file called index.html and then I have a file called sign.html.', 'start': 1672.399, 'duration': 6.346}, {'end': 1683.109, 'text': 'And this is what makes up my guestbook app or what will make up my guestbook app.', 'start': 1679.185, 'duration': 3.924}, {'end': 1693.705, 'text': "And the reason why I'm doing it this way is because for me it's a lot easier to work with created index or created HTML files to start with,", 'start': 1684.079, 'duration': 9.626}, {'end': 1695.846, 'text': 'because I know what my app is going to look like.', 'start': 1693.705, 'duration': 2.141}], 'summary': 'Creating a guest book app in django with html files for index and sign.', 'duration': 29.357, 'max_score': 1593.845, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81593845.jpg'}, {'end': 1818.44, 'src': 'heatmap', 'start': 1732.351, 'weight': 0.705, 'content': [{'end': 1736.353, 'text': "And it's what, 40 lines of code and 42.", 'start': 1732.351, 'duration': 4.002}, {'end': 1738.114, 'text': 'So about 80 lines of code.', 'start': 1736.353, 'duration': 1.761}, {'end': 1741.036, 'text': 'It would just take too long to type out in a video.', 'start': 1738.454, 'duration': 2.582}, {'end': 1747.098, 'text': "Instead what I'll do is I'll convert those templates to be used in my web app.", 'start': 1741.956, 'duration': 5.142}, {'end': 1753.22, 'text': "The first thing I need to do is I need to create a directory called templates, and that's where I'm going to store those HTML files,", 'start': 1747.198, 'duration': 6.022}, {'end': 1761.682, 'text': 'because the HTML files are going to go from being plain HTML to templates, which means that they have some extra functionality in them,', 'start': 1753.22, 'duration': 8.462}, {'end': 1764.103, 'text': 'so you can make them dynamic in a sense.', 'start': 1761.682, 'duration': 2.421}, {'end': 1767.124, 'text': 'This will make more sense once I actually start adding the dynamic parts.', 'start': 1764.243, 'duration': 2.881}, {'end': 1771.805, 'text': 'but I need to create a folder called templates in my guestbook directory.', 'start': 1768.324, 'duration': 3.481}, {'end': 1777.447, 'text': "Then inside of templates, what I'm going to do is I'm going to create another directory called guestbook.", 'start': 1772.526, 'duration': 4.921}, {'end': 1788.151, 'text': "The reason why I'm doing this is because what Django does is it's going to take all the templates from all the apps that you have in a particular project and it's going to combine them into one big templates file.", 'start': 1777.487, 'duration': 10.664}, {'end': 1797.334, 'text': "template files that have the same name like index.html, then you're going to run into problems with files being overwritten.", 'start': 1790.572, 'duration': 6.762}, {'end': 1803.256, 'text': "But if you put a subdirectory inside of your templates directory that's the same name as your app,", 'start': 1797.734, 'duration': 5.522}, {'end': 1809.017, 'text': "then it's a lot easier for you to know where those files are and they won't get overwritten.", 'start': 1803.256, 'duration': 5.761}, {'end': 1810.237, 'text': "So that's why I did that.", 'start': 1809.117, 'duration': 1.12}, {'end': 1818.44, 'text': "So with that, I'm going to go to guestbook and then templates, guestbook, and I'm just going to transfer those two files over.", 'start': 1810.778, 'duration': 7.662}], 'summary': 'Converting html files to templates for dynamic functionality, creating directories to avoid file overwriting.', 'duration': 86.089, 'max_score': 1732.351, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81732351.jpg'}, {'end': 1810.237, 'src': 'embed', 'start': 1772.526, 'weight': 2, 'content': [{'end': 1777.447, 'text': "Then inside of templates, what I'm going to do is I'm going to create another directory called guestbook.", 'start': 1772.526, 'duration': 4.921}, {'end': 1788.151, 'text': "The reason why I'm doing this is because what Django does is it's going to take all the templates from all the apps that you have in a particular project and it's going to combine them into one big templates file.", 'start': 1777.487, 'duration': 10.664}, {'end': 1797.334, 'text': "template files that have the same name like index.html, then you're going to run into problems with files being overwritten.", 'start': 1790.572, 'duration': 6.762}, {'end': 1803.256, 'text': "But if you put a subdirectory inside of your templates directory that's the same name as your app,", 'start': 1797.734, 'duration': 5.522}, {'end': 1809.017, 'text': "then it's a lot easier for you to know where those files are and they won't get overwritten.", 'start': 1803.256, 'duration': 5.761}, {'end': 1810.237, 'text': "So that's why I did that.", 'start': 1809.117, 'duration': 1.12}], 'summary': 'Creating a subdirectory called guestbook inside templates to avoid file overwriting issues in django.', 'duration': 37.711, 'max_score': 1772.526, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81772526.jpg'}, {'end': 1869.576, 'src': 'embed', 'start': 1835.649, 'weight': 3, 'content': [{'end': 1839.552, 'text': "And what I'm going to do is I'm going to create a couple of views for the guest book.", 'start': 1835.649, 'duration': 3.903}, {'end': 1844.075, 'text': 'Those will return each one of the templates.', 'start': 1840.833, 'duration': 3.242}, {'end': 1851.899, 'text': 'The index view is going to return the index template, and the sign view is going to return the sign template.', 'start': 1844.195, 'duration': 7.704}, {'end': 1859.323, 'text': "What I'll do is create a function called index, and this is going to be similar to the one for hello.", 'start': 1852.059, 'duration': 7.264}, {'end': 1861.224, 'text': 'We see hello, so index requests.', 'start': 1859.403, 'duration': 1.821}, {'end': 1869.576, 'text': "But instead of returning HTTP response, which is the most generic one, I'm going to return template.", 'start': 1861.724, 'duration': 7.852}], 'summary': 'Creating views for guest book with index and sign templates.', 'duration': 33.927, 'max_score': 1835.649, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81835649.jpg'}, {'end': 2174.273, 'src': 'heatmap', 'start': 1892.552, 'weight': 0.805, 'content': [{'end': 1895.877, 'text': "And then for the sign I'll do the same thing.", 'start': 1892.552, 'duration': 3.325}, {'end': 1898.981, 'text': 'So request and then return render request.', 'start': 1895.957, 'duration': 3.024}, {'end': 1903.728, 'text': "And let's see, we have guest book slash sign.", 'start': 1900.403, 'duration': 3.325}, {'end': 1911.633, 'text': 'OK, so I have a guest book slash sign and now what I need to do is I need to create a URLs file for guest books.', 'start': 1905.771, 'duration': 5.862}, {'end': 1914.874, 'text': "So I'll create a new file here and I'll call this urls.py.", 'start': 1911.753, 'duration': 3.121}, {'end': 1924.537, 'text': "Let me go ahead and close the one for hello, just so I don't confuse myself, and what I'm going to do is I'm going to look at the URLs for my project,", 'start': 1915.294, 'duration': 9.243}, {'end': 1926.077, 'text': "and it's since it's going to be similar.", 'start': 1924.537, 'duration': 1.54}, {'end': 1932.179, 'text': "What I'll do is I'll copy this part so from the URLs down.", 'start': 1926.557, 'duration': 5.622}, {'end': 1934.72, 'text': "Just so I don't have to type it again.", 'start': 1933.64, 'duration': 1.08}, {'end': 1937.949, 'text': 'So I still need the path.', 'start': 1936.448, 'duration': 1.501}, {'end': 1945.772, 'text': "Obviously I won't have admin and then I won't have admin.site URLs.", 'start': 1938.449, 'duration': 7.323}, {'end': 1952.155, 'text': "So the first URL that I'm going to use is going to be blank, meaning like the index.", 'start': 1946.333, 'duration': 5.822}, {'end': 1960.059, 'text': "So what I'm going to do for the patterns in the project is I'm going to add a guest book path.", 'start': 1952.695, 'duration': 7.364}, {'end': 1967.462, 'text': "And then I'm going to include an this file got overwritten, so this should be include.", 'start': 1961.471, 'duration': 5.991}, {'end': 1973.213, 'text': 'Hello dot URLs and then this is going to be include.', 'start': 1969.145, 'duration': 4.068}, {'end': 1983.037, 'text': 'guestbook.urls. okay, so now that i have the guestbook urls, anytime i go to slash guestbook,', 'start': 1975.069, 'duration': 7.968}, {'end': 1988.463, 'text': "it's going to send me to this urls file and i can close this out because i won't be needing it anymore.", 'start': 1983.037, 'duration': 5.426}, {'end': 1995.911, 'text': "so on the index for guestbook, i'm going to direct the user to use.index and i'm going to name this index.", 'start': 1988.463, 'duration': 7.448}, {'end': 2006.359, 'text': "And then, same thing, when they go to sign, I'm going to direct them to views that sign and I'm going to name this URL sign.", 'start': 1996.992, 'duration': 9.367}, {'end': 2010.262, 'text': 'So with that, that should be enough to see it when I load.', 'start': 2007.18, 'duration': 3.082}, {'end': 2014.846, 'text': 'This so Python managed pi run server.', 'start': 2011.984, 'duration': 2.862}, {'end': 2020.488, 'text': 'And include is not defined.', 'start': 2018.826, 'duration': 1.662}, {'end': 2025.112, 'text': 'So yes, something got overridden when I was doing this.', 'start': 2021.409, 'duration': 3.703}, {'end': 2027.194, 'text': "So I'll just add the include here.", 'start': 2025.192, 'duration': 2.002}, {'end': 2028.515, 'text': "That's the minor error.", 'start': 2027.274, 'duration': 1.241}, {'end': 2039.325, 'text': 'So when I do that again, it should tell me that unable to connect because I need to restart the server.', 'start': 2029.116, 'duration': 10.209}, {'end': 2051.996, 'text': 'Oh, and then in my views here, I actually, or excuse me, my URLs, I need to import all the views that I have.', 'start': 2041.329, 'duration': 10.667}, {'end': 2059.702, 'text': 'So from.views, import, or from this import views.', 'start': 2052.536, 'duration': 7.166}, {'end': 2061.123, 'text': 'I just want all the views that I have.', 'start': 2059.782, 'duration': 1.341}, {'end': 2067.047, 'text': 'All right, so now if I run the server, it should work a little better this time.', 'start': 2061.922, 'duration': 5.125}, {'end': 2069.869, 'text': "Okay, so it's telling me that I have access to the guest book.", 'start': 2067.627, 'duration': 2.242}, {'end': 2075.223, 'text': 'And now I see the guestbook page here and I see the sign page here.', 'start': 2071.161, 'duration': 4.062}, {'end': 2081.885, 'text': 'If I click on this link, I get an error because there is no link to the sign in page or the sign page.', 'start': 2075.443, 'duration': 6.442}, {'end': 2087.427, 'text': "So what I'll do is I will go to my template, open up the sign file and look for that link.", 'start': 2081.965, 'duration': 5.462}, {'end': 2091.429, 'text': "So that link is, or actually it's in the index.", 'start': 2087.746, 'duration': 3.683}, {'end': 2098.851, 'text': 'So that link is pointing to sign.html, but I want it to point to the URL that is in my Django app.', 'start': 2091.929, 'duration': 6.922}, {'end': 2108.496, 'text': "So to do that, I'm going to use the first of the commands that I can call in the Django template language.", 'start': 2099.332, 'duration': 9.164}, {'end': 2110.217, 'text': 'And that is URL.', 'start': 2108.676, 'duration': 1.541}, {'end': 2114.381, 'text': 'So by passing URL in here and a name of URLs.', 'start': 2110.798, 'duration': 3.583}, {'end': 2116.362, 'text': 'so sign.', 'start': 2114.381, 'duration': 1.981}, {'end': 2122.447, 'text': "what Django is going to do is it's going to find this and it's going to be like okay, find the URL for sign.", 'start': 2116.362, 'duration': 6.085}, {'end': 2125.87, 'text': "It's going to look at URLs and it's going to generate that URL for me.", 'start': 2122.488, 'duration': 3.382}, {'end': 2134.66, 'text': 'So if I run this again, click the link, it now takes me to the sign, the guestbook page.', 'start': 2127.352, 'duration': 7.308}, {'end': 2141.783, 'text': "now, of course, you probably notice how ugly this is, just doesn't look like the templates that i showed you before,", 'start': 2134.66, 'duration': 7.123}, {'end': 2146.124, 'text': "and that's because i need to have the static files.", 'start': 2141.783, 'duration': 4.341}, {'end': 2153.326, 'text': "so i'm going to create a new directory called static and then in this directory i'm going to do the same thing.", 'start': 2146.124, 'duration': 7.202}, {'end': 2160.404, 'text': "i'm going to create guestbook And then inside of guestbook I can add the static files that I need.", 'start': 2153.326, 'duration': 7.078}, {'end': 2166.107, 'text': "So I'll go out here and I'll go to static and I would transfer the CSS files.", 'start': 2160.524, 'duration': 5.583}, {'end': 2174.273, 'text': 'So theme, sign, bootstrap theme, and then bootstrap.min.', 'start': 2166.187, 'duration': 8.086}], 'summary': 'Creating and configuring urls for a django guestbook app, resolving errors and adding static files.', 'duration': 281.721, 'max_score': 1892.552, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81892552.jpg'}, {'end': 1973.213, 'src': 'embed', 'start': 1938.449, 'weight': 4, 'content': [{'end': 1945.772, 'text': "Obviously I won't have admin and then I won't have admin.site URLs.", 'start': 1938.449, 'duration': 7.323}, {'end': 1952.155, 'text': "So the first URL that I'm going to use is going to be blank, meaning like the index.", 'start': 1946.333, 'duration': 5.822}, {'end': 1960.059, 'text': "So what I'm going to do for the patterns in the project is I'm going to add a guest book path.", 'start': 1952.695, 'duration': 7.364}, {'end': 1967.462, 'text': "And then I'm going to include an this file got overwritten, so this should be include.", 'start': 1961.471, 'duration': 5.991}, {'end': 1973.213, 'text': 'Hello dot URLs and then this is going to be include.', 'start': 1969.145, 'duration': 4.068}], 'summary': 'Configuring urls with a guest book path for the project.', 'duration': 34.764, 'max_score': 1938.449, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81938449.jpg'}, {'end': 2174.273, 'src': 'embed', 'start': 2146.124, 'weight': 1, 'content': [{'end': 2153.326, 'text': "so i'm going to create a new directory called static and then in this directory i'm going to do the same thing.", 'start': 2146.124, 'duration': 7.202}, {'end': 2160.404, 'text': "i'm going to create guestbook And then inside of guestbook I can add the static files that I need.", 'start': 2153.326, 'duration': 7.078}, {'end': 2166.107, 'text': "So I'll go out here and I'll go to static and I would transfer the CSS files.", 'start': 2160.524, 'duration': 5.583}, {'end': 2174.273, 'text': 'So theme, sign, bootstrap theme, and then bootstrap.min.', 'start': 2166.187, 'duration': 8.086}], 'summary': "Creating a new 'static' directory and transferring css files for guestbook.", 'duration': 28.149, 'max_score': 2146.124, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ82146124.jpg'}], 'start': 1553.018, 'title': 'Organizing django apps and creating dynamic templates and urls', 'summary': 'Covers the significance of organizing django apps and creating a guest book app, as well as transforming html files into templates, including the creation of views, urls, and the incorporation of static files for web app enhancement.', 'chapters': [{'end': 1732.171, 'start': 1553.018, 'title': 'Organizing django apps and creating guest book', 'summary': 'Explains the importance of organizing django apps and demonstrates creating a more interesting guest book app, including adding it to installed apps and creating html files for the app.', 'duration': 179.153, 'highlights': ['The chapter explains the importance of organizing Django apps Emphasizes the need to give a unique name to the path in URLs for the project and the flexibility to choose the index, depending on app organization. Mentions the necessity of making a clear decision to avoid confusion for both the developer and Django.', "Demonstrates creating a more interesting guest book app Shows the process of creating a guest book app, including using 'Python manage.pie start app' command and adding it to the installed apps in settings. Mentions the creation of index.html and sign.html files to make up the guest book app.", 'Emphasizes the need to make a clear decision to avoid confusion for both the developer and Django Stresses the importance of making a clear decision when choosing the index for apps, as confusion can arise for both the developer and the Django framework if a clear decision is not made.']}, {'end': 2336.541, 'start': 1732.351, 'title': 'Creating dynamic templates and urls in django', 'summary': 'Discusses the process of converting html files to templates in django by creating a directory for templates, transferring files, creating views and urls, and incorporating static files to improve the appearance of the web app.', 'duration': 604.19, 'highlights': ['The process of converting HTML files to templates in Django involves creating a directory for templates and transferring the files to be used in the web app. The speaker explains the need to create a directory called templates and store the HTML files in it, which will be converted into templates with additional functionality to make them dynamic.', 'The importance of creating a subdirectory with the same name as the app inside the templates directory to prevent file overwriting in Django. Creating a subdirectory with the same name as the app inside the templates directory helps avoid problems with files being overwritten, making it easier to locate and manage the files.', 'The process of creating views for the guest book and returning the index and sign templates in Django. The speaker creates views for the guest book, with each view returning a specific template - the index view returns the index template and the sign view returns the sign template.', 'The creation of URL patterns for the guest book and the inclusion of the guest book URLs in the project. The speaker explains the process of creating URL patterns for the guest book and including the guest book URLs in the project to direct users to the appropriate views.', 'Incorporating static files to improve the appearance of the web app by creating a static directory, adding static files, and referencing them in the templates. The speaker demonstrates the process of creating a static directory, adding CSS files, and referencing them in the templates using the {% static %} command to enhance the appearance of the web app.']}], 'duration': 783.523, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ81553018.jpg', 'highlights': ["Demonstrates creating a more interesting guest book app Shows the process of creating a guest book app, including using 'Python manage.pie start app' command and adding it to the installed apps in settings. Mentions the creation of index.html and sign.html files to make up the guest book app.", 'Incorporating static files to improve the appearance of the web app by creating a static directory, adding static files, and referencing them in the templates. The speaker demonstrates the process of creating a static directory, adding CSS files, and referencing them in the templates using the {% static %} command to enhance the appearance of the web app.', 'The process of converting HTML files to templates in Django involves creating a directory for templates and transferring the files to be used in the web app. The speaker explains the need to create a directory called templates and store the HTML files in it, which will be converted into templates with additional functionality to make them dynamic.', 'The process of creating views for the guest book and returning the index and sign templates in Django. The speaker creates views for the guest book, with each view returning a specific template - the index view returns the index template and the sign view returns the sign template.', 'The creation of URL patterns for the guest book and the inclusion of the guest book URLs in the project. The speaker explains the process of creating URL patterns for the guest book and including the guest book URLs in the project to direct users to the appropriate views.', 'The importance of creating a subdirectory with the same name as the app inside the templates directory to prevent file overwriting in Django. Creating a subdirectory with the same name as the app inside the templates directory helps avoid problems with files being overwritten, making it easier to locate and manage the files.', 'The chapter explains the importance of organizing Django apps Emphasizes the need to give a unique name to the path in URLs for the project and the flexibility to choose the index, depending on app organization. Mentions the necessity of making a clear decision to avoid confusion for both the developer and Django.']}, {'end': 3105.075, 'segs': [{'end': 2457.847, 'src': 'embed', 'start': 2410.325, 'weight': 0, 'content': [{'end': 2414.646, 'text': "So it's kind of a, a liaison between the two.", 'start': 2410.325, 'duration': 4.321}, {'end': 2418.149, 'text': 'And anything you do to one will affect the other.', 'start': 2415.627, 'duration': 2.522}, {'end': 2424.153, 'text': "So if there weren't models, then you would have to write code to access the database very directly.", 'start': 2419.85, 'duration': 4.303}, {'end': 2428.596, 'text': 'But with the model, Django is going to take care of the heavy lifting for you.', 'start': 2424.593, 'duration': 4.003}, {'end': 2431.979, 'text': "So to create a model, what I'm going to do is create a class.", 'start': 2429.117, 'duration': 2.862}, {'end': 2436.162, 'text': 'And this class is going to be the name of the table that I want to create.', 'start': 2432.199, 'duration': 3.963}, {'end': 2439.124, 'text': 'So in this particular case, I want to create a table called comment.', 'start': 2436.222, 'duration': 2.902}, {'end': 2443.899, 'text': "Then I'm going to inherit from models dot model.", 'start': 2440.595, 'duration': 3.304}, {'end': 2448.544, 'text': 'And this will just inject some of the model functionality into this class.', 'start': 2445.341, 'duration': 3.203}, {'end': 2449.746, 'text': "So it's not just a regular class.", 'start': 2448.564, 'duration': 1.182}, {'end': 2453.446, 'text': 'then for this class.', 'start': 2451.465, 'duration': 1.981}, {'end': 2457.847, 'text': 'the attributes of the class will represent the columns in the database.', 'start': 2453.446, 'duration': 4.401}], 'summary': 'Django models automate database access, reducing manual coding. creating a model involves defining a class representing a database table.', 'duration': 47.522, 'max_score': 2410.325, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ82410325.jpg'}, {'end': 2626.417, 'src': 'embed', 'start': 2597.49, 'weight': 2, 'content': [{'end': 2607.55, 'text': "And now what I want to do is I want to go to the admin part, And I'm going to register that comment model on my admin.", 'start': 2597.49, 'duration': 10.06}, {'end': 2610.634, 'text': 'So from dot models import.', 'start': 2607.73, 'duration': 2.904}, {'end': 2621.055, 'text': "comment and then what I want to do is I want to say admin.site.register, and I'm going to pass in comment.", 'start': 2612.512, 'duration': 8.543}, {'end': 2626.417, 'text': "so what this is going to do is it's going to allow me to modify the comments on the admin dashboard.", 'start': 2621.055, 'duration': 5.362}], 'summary': 'Register comment model on admin to modify comments.', 'duration': 28.927, 'max_score': 2597.49, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ82597490.jpg'}, {'end': 2645.238, 'src': 'heatmap', 'start': 2597.49, 'weight': 0.851, 'content': [{'end': 2607.55, 'text': "And now what I want to do is I want to go to the admin part, And I'm going to register that comment model on my admin.", 'start': 2597.49, 'duration': 10.06}, {'end': 2610.634, 'text': 'So from dot models import.', 'start': 2607.73, 'duration': 2.904}, {'end': 2621.055, 'text': "comment and then what I want to do is I want to say admin.site.register, and I'm going to pass in comment.", 'start': 2612.512, 'duration': 8.543}, {'end': 2626.417, 'text': "so what this is going to do is it's going to allow me to modify the comments on the admin dashboard.", 'start': 2621.055, 'duration': 5.362}, {'end': 2639.856, 'text': "so if I save this and then quit and start the server again, I will go to my admin dashboard and and I'm logged in already.", 'start': 2626.417, 'duration': 13.439}, {'end': 2645.238, 'text': 'And I see here, I see my app name, so guest book, and I see comments.', 'start': 2640.196, 'duration': 5.042}], 'summary': 'Register comment model on admin to modify comments on the admin dashboard.', 'duration': 47.748, 'max_score': 2597.49, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ82597490.jpg'}, {'end': 2724.592, 'src': 'heatmap', 'start': 2677.393, 'weight': 0.729, 'content': [{'end': 2681.596, 'text': 'To do this, I will type python manage.py and then make migrations.', 'start': 2677.393, 'duration': 4.203}, {'end': 2689.482, 'text': 'Once I do that, I will have this new migrations file.', 'start': 2683.678, 'duration': 5.804}, {'end': 2694.314, 'text': 'If you look down here, you will see the columns that I added.', 'start': 2689.863, 'duration': 4.451}, {'end': 2700.078, 'text': 'So an ID that was created for me automatically, like I said, and then a name, a comment, and a date added.', 'start': 2694.374, 'duration': 5.704}, {'end': 2704.602, 'text': 'So this is basically telling Django how to create a table in the database.', 'start': 2700.439, 'duration': 4.163}, {'end': 2715.07, 'text': "And then if I go and type manage.py migrate, it's going to actually run this migration and create it in the database.", 'start': 2706.283, 'duration': 8.787}, {'end': 2724.592, 'text': 'So now let me load up the table in jade so we can see it.', 'start': 2717.232, 'duration': 7.36}], 'summary': 'Using python manage.py to create and run migrations, adding columns for id, name, comment, and date added in django to create a table in the database.', 'duration': 47.199, 'max_score': 2677.393, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ82677393.jpg'}, {'end': 2937.742, 'src': 'embed', 'start': 2909.54, 'weight': 1, 'content': [{'end': 2913.325, 'text': "And then to do this, I'm going to call comments and then objects.", 'start': 2909.54, 'duration': 3.785}, {'end': 2920.636, 'text': "So now I'm asking for the objects in the database and I want to order them by something.", 'start': 2913.486, 'duration': 7.15}, {'end': 2929.979, 'text': 'So to order them by something. I pass in the column that I want to order by, in this particular case, date added and I added the minus in front of it.', 'start': 2921.417, 'duration': 8.562}, {'end': 2933.76, 'text': "So I'm ordering in reverse chronological order.", 'start': 2930.199, 'duration': 3.561}, {'end': 2937.742, 'text': 'So the latest comments to get added will be displayed first.', 'start': 2933.86, 'duration': 3.882}], 'summary': 'Ordering database objects by date added in reverse chronological order to display latest comments first.', 'duration': 28.202, 'max_score': 2909.54, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ82909540.jpg'}, {'end': 3035.639, 'src': 'embed', 'start': 3008.478, 'weight': 3, 'content': [{'end': 3012.461, 'text': 'And what I want this to do is repeat for each comment in the database.', 'start': 3008.478, 'duration': 3.983}, {'end': 3015.603, 'text': "So to repeat something, I'm going to put a loop around it.", 'start': 3012.541, 'duration': 3.062}, {'end': 3024.512, 'text': 'So inside the template, I can run the for command, so for something.', 'start': 3016.263, 'duration': 8.249}, {'end': 3027.273, 'text': "In this case, I'll say for C in comments.", 'start': 3024.592, 'duration': 2.681}, {'end': 3029.795, 'text': 'That comments comes from the context that I just created.', 'start': 3027.293, 'duration': 2.502}, {'end': 3035.639, 'text': "For each comment in comments, which is going to be C, you're going to do something.", 'start': 3030.476, 'duration': 5.163}], 'summary': 'Implement a loop to iterate through each comment in the database.', 'duration': 27.161, 'max_score': 3008.478, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ83008478.jpg'}], 'start': 2336.541, 'title': 'Creating a database model for comments and django guestbook comments display', 'summary': 'Explains the process of creating a database model for comments, including defining the attributes, generating a migration, and running the migration. it also covers retrieving and displaying comments from a database in a django guestbook, including creating a variable to hold comments, ordering them by date added, passing the comments to the template, and using a for loop to display each comment with its name and text.', 'chapters': [{'end': 2832.782, 'start': 2336.541, 'title': 'Creating database model for comments', 'summary': 'Explains the process of creating a database model for comments, including defining the attributes, generating a migration, and running the migration to create the table in the database.', 'duration': 496.241, 'highlights': ['The process of creating a database model involves defining a class for the table, inheriting from models.model, and specifying attributes to represent the columns in the database.', 'Explaining the purpose of using Django models as a liaison between code and database, with automatic reflection of code changes on the database and vice versa.', 'Detailing the attributes of the comment model, including name, comment, and date added columns, with specifications like max length for name and default time for date added.', "Demonstrating the use of migrations to generate the table in the database, including making migrations with 'python manage.py makemigrations' and running the migration with 'python manage.py migrate'.", 'Showing the process of adding a comment through the admin dashboard and validating its addition to the database.']}, {'end': 3105.075, 'start': 2833.563, 'title': 'Django guestbook comments display', 'summary': 'Discusses how to retrieve and display comments from a database in a django guestbook. it covers creating a variable to hold comments, ordering them by date added, passing the comments to the template, and using a for loop to display each comment with its name and text.', 'duration': 271.512, 'highlights': ["Creating a variable to hold comments and retrieving them from the database The speaker creates a variable called 'comments' to hold the comments and retrieves them from the database using the comments model, aiming to display them in the template.", "Ordering comments by date added in reverse chronological order The speaker orders the comments by the 'date added' column in reverse chronological order, ensuring that the latest comments will be displayed first, providing a dynamic and up-to-date experience for users.", "Passing the comments to the template for display The speaker creates a 'context' variable and passes the comments to the template using 'render', ensuring that the values are available for the template, allowing for dynamic display of the comments.", 'Using a for loop to display each comment with its name and text The speaker utilizes a for loop in the template to iterate through each comment and display its name and text, ultimately allowing for the dynamic and accurate display of all comments retrieved from the database.']}], 'duration': 768.534, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ82336541.jpg', 'highlights': ['Explaining the purpose of using Django models as a liaison between code and database, with automatic reflection of code changes on the database and vice versa.', "Ordering comments by date added in reverse chronological order The speaker orders the comments by the 'date added' column in reverse chronological order, ensuring that the latest comments will be displayed first, providing a dynamic and up-to-date experience for users.", 'Showing the process of adding a comment through the admin dashboard and validating its addition to the database.', 'Using a for loop to display each comment with its name and text The speaker utilizes a for loop in the template to iterate through each comment and display its name and text, ultimately allowing for the dynamic and accurate display of all comments retrieved from the database.', 'Detailing the attributes of the comment model, including name, comment, and date added columns, with specifications like max length for name and default time for date added.']}, {'end': 3936.806, 'segs': [{'end': 3174.039, 'src': 'embed', 'start': 3106.696, 'weight': 0, 'content': [{'end': 3111.159, 'text': "So it's a lot easier to do when you know what you want your apps to look like ahead of time.", 'start': 3106.696, 'duration': 4.463}, {'end': 3116.623, 'text': "And basically you just change the functionality step by step until it's working correctly.", 'start': 3112.2, 'duration': 4.423}, {'end': 3126.705, 'text': 'So now that the home guestbook page is done, what I want to do now is I want to work on the sign the guestbook page.', 'start': 3118.382, 'duration': 8.323}, {'end': 3133.488, 'text': "And the sign the guestbook page is going to be a little more complicated, but it's still fairly straightforward.", 'start': 3127.265, 'duration': 6.223}, {'end': 3139.81, 'text': 'So what I need to do is I need to create something that represents a form,', 'start': 3135.469, 'duration': 4.341}, {'end': 3146.133, 'text': 'and then I need to get that form data when they hit the sign button and I need to put it into the database.', 'start': 3139.81, 'duration': 6.323}, {'end': 3158.653, 'text': "So if I go back to my project here, what I'm going to do is I'm going to create a new file called forms.py.", 'start': 3147.629, 'duration': 11.024}, {'end': 3161.714, 'text': 'And as you can imagine, this is where my forms are going to be.', 'start': 3159.133, 'duration': 2.581}, {'end': 3170.837, 'text': 'So forms are going to be somewhat similar to models, in a sense that a class represents something in HTML,', 'start': 3162.154, 'duration': 8.683}, {'end': 3174.039, 'text': 'just like the class represents a database table.', 'start': 3170.837, 'duration': 3.202}], 'summary': 'Developing app functionalities step by step, starting with home guestbook page and now moving on to sign the guestbook page.', 'duration': 67.343, 'max_score': 3106.696, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ83106696.jpg'}, {'end': 3352.267, 'src': 'heatmap', 'start': 3271.02, 'weight': 1, 'content': [{'end': 3277.863, 'text': "And what I'll do is I'll go back to the views and I'm going to allow my template to have access to that form that I just created.", 'start': 3271.02, 'duration': 6.843}, {'end': 3284.946, 'text': "So if I go to the sign view here, what I'm going to do is I'm going to instantiate the form.", 'start': 3278.443, 'duration': 6.503}, {'end': 3288.468, 'text': 'So first I need to import it from forms.', 'start': 3285.386, 'duration': 3.082}, {'end': 3292.269, 'text': "So comment form, and I'm going to instantiate it here.", 'start': 3288.568, 'duration': 3.701}, {'end': 3293.37, 'text': 'So comment form.', 'start': 3292.61, 'duration': 0.76}, {'end': 3299.4, 'text': "And that's basically just creating the form and then I'll create a context.", 'start': 3295.959, 'duration': 3.441}, {'end': 3303.141, 'text': 'So form, so I can pass that form to my template.', 'start': 3299.94, 'duration': 3.201}, {'end': 3315.404, 'text': "And then inside of my sign by HTML file, what I'll do is I'll simply just display that form somewhere just so we can see what it looks like.", 'start': 3306.282, 'duration': 9.122}, {'end': 3316.905, 'text': "So it's a variable.", 'start': 3316.004, 'duration': 0.901}, {'end': 3320.345, 'text': "So just form like that because it's in the context.", 'start': 3317.025, 'duration': 3.32}, {'end': 3329.949, 'text': "And now if I refresh this, and may need to restart because it's a template file and there's occasionally problems with it.", 'start': 3321.086, 'duration': 8.863}, {'end': 3333.932, 'text': 'Okay, so now I see I have a new form.', 'start': 3330.73, 'duration': 3.202}, {'end': 3335.414, 'text': 'I have a name and I have a comment.', 'start': 3333.992, 'duration': 1.422}, {'end': 3343.36, 'text': "Obviously it's pretty ugly, but we can see that by just adding that form there, I'm able to get a second form on the page.", 'start': 3336.014, 'duration': 7.346}, {'end': 3345.782, 'text': "But that's not what I want my form to look like.", 'start': 3343.8, 'duration': 1.982}, {'end': 3352.267, 'text': "So what I'm going to do instead is I'm going to simply convert these fields to be the form fields that I have here.", 'start': 3345.962, 'duration': 6.305}], 'summary': 'Creating and displaying a form in a template, with a new form featuring name and comment fields.', 'duration': 81.247, 'max_score': 3271.02, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ83271020.jpg'}, {'end': 3329.949, 'src': 'embed', 'start': 3295.959, 'weight': 5, 'content': [{'end': 3299.4, 'text': "And that's basically just creating the form and then I'll create a context.", 'start': 3295.959, 'duration': 3.441}, {'end': 3303.141, 'text': 'So form, so I can pass that form to my template.', 'start': 3299.94, 'duration': 3.201}, {'end': 3315.404, 'text': "And then inside of my sign by HTML file, what I'll do is I'll simply just display that form somewhere just so we can see what it looks like.", 'start': 3306.282, 'duration': 9.122}, {'end': 3316.905, 'text': "So it's a variable.", 'start': 3316.004, 'duration': 0.901}, {'end': 3320.345, 'text': "So just form like that because it's in the context.", 'start': 3317.025, 'duration': 3.32}, {'end': 3329.949, 'text': "And now if I refresh this, and may need to restart because it's a template file and there's occasionally problems with it.", 'start': 3321.086, 'duration': 8.863}], 'summary': 'Creating a form and displaying it in the html file.', 'duration': 33.99, 'max_score': 3295.959, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ83295959.jpg'}, {'end': 3606.663, 'src': 'embed', 'start': 3580.882, 'weight': 6, 'content': [{'end': 3585.504, 'text': 'And one last thing I need to add in here is the cross site request forgery token.', 'start': 3580.882, 'duration': 4.622}, {'end': 3587.266, 'text': "So that's just for security purposes.", 'start': 3585.544, 'duration': 1.722}, {'end': 3589.908, 'text': "And the form won't work if I don't have that.", 'start': 3588.166, 'duration': 1.742}, {'end': 3595.993, 'text': 'So basically, that just verifies that the form data is coming from the page that generated the form.', 'start': 3590.028, 'duration': 5.965}, {'end': 3600.838, 'text': "It's not coming from someone else who is just passing form data to your route directly.", 'start': 3596.133, 'duration': 4.705}, {'end': 3604.541, 'text': "Instead, it's going to make sure it's coming from that particular form.", 'start': 3601.138, 'duration': 3.403}, {'end': 3606.663, 'text': 'So I just need to add that there.', 'start': 3605.061, 'duration': 1.602}], 'summary': 'Adding a cross site request forgery token for security to verify form data source.', 'duration': 25.781, 'max_score': 3580.882, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ83580882.jpg'}, {'end': 3682.69, 'src': 'embed', 'start': 3654.127, 'weight': 7, 'content': [{'end': 3662.419, 'text': "If it is a post request, what I'm going to do is I'm going to instantiate the form again, but instead of instantiating the form with nothing,", 'start': 3654.127, 'duration': 8.292}, {'end': 3665.861, 'text': "I'm going to instantiate it with the data that comes from the request.", 'start': 3662.419, 'duration': 3.442}, {'end': 3673.445, 'text': "So by typing request.post, I'm going to be passing that form data into this comment form.", 'start': 3666.761, 'duration': 6.684}, {'end': 3682.69, 'text': "And then what I can do is I can say if this form is actually valid, so if all the data that I want is there, I'll just say form is valid.", 'start': 3675.026, 'duration': 7.664}], 'summary': 'Instantiating the form with request data for a post request and checking its validity.', 'duration': 28.563, 'max_score': 3654.127, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ83654127.jpg'}], 'start': 3106.696, 'title': 'App development process and creating and using html forms in django', 'summary': 'Discusses the step-by-step process of developing app functionalities, focusing on creating the home guestbook page and planning the sign the guestbook page, while also demonstrating creating and using html forms in django, including creating new forms file, instantiating a form in views, handling post requests, and redirecting to the index upon form submission.', 'chapters': [{'end': 3146.133, 'start': 3106.696, 'title': 'App development process', 'summary': 'Discusses the process of developing app functionalities step by step, focusing on creating the home guestbook page and planning to work on the sign the guestbook page, which involves creating a form and storing its data into the database.', 'duration': 39.437, 'highlights': ['Creating app functionalities step by step is emphasized, making it easier to achieve the desired app design and functionality.', 'Focus on developing the home guestbook page is highlighted as a completed step in the app development process.', 'Planning to work on the sign the guestbook page, involving the creation of a form and storing its data into the database, is outlined as the next task.', 'The process of creating a form and storing its data into the database is mentioned as the next step in the app development process.']}, {'end': 3936.806, 'start': 3147.629, 'title': 'Creating and using html forms in django', 'summary': 'Demonstrates creating and using html forms in django, showcasing the process of creating a new forms file, instantiating a form in views, handling post requests, and redirecting to the index upon form submission.', 'duration': 789.177, 'highlights': ["The process of creating a new forms file called forms.py and defining a new class 'comment form' to represent an HTML form with attributes such as name and comment. Demonstrates the creation of a new forms file called forms.py and the definition of a new class 'comment form' to represent an HTML form with attributes such as name and comment.", 'Instantiating the form in views and creating a context to pass the form to the template, allowing the display of the form in the HTML file. Illustrates the instantiation of the form in views and the creation of a context to pass the form to the template, enabling the display of the form in the HTML file.', "Handling post requests by modifying the method to be 'post', defining the form action, and adding cross-site request forgery token for security purposes. Details the process of handling post requests by modifying the method to be 'post', defining the form action, and adding cross-site request forgery token for security purposes.", 'Handling post requests in views, instantiating the form with request data, validating the form data, and creating a new row in the database using the form data. Explains the handling of post requests in views, including instantiating the form with request data, validating the form data, and creating a new row in the database using the form data.', 'Redirecting to the index upon form submission by using the redirect shortcut, enabling the form data to be added to the database and displayed in the guestbook page. Describes the process of redirecting to the index upon form submission by using the redirect shortcut, enabling the form data to be added to the database and displayed in the guestbook page.']}], 'duration': 830.11, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/QVX-etwgvJ8/pics/QVX-etwgvJ83106696.jpg', 'highlights': ['Creating app functionalities step by step is emphasized, making it easier to achieve the desired app design and functionality.', 'Focus on developing the home guestbook page is highlighted as a completed step in the app development process.', 'Planning to work on the sign the guestbook page, involving the creation of a form and storing its data into the database, is outlined as the next task.', 'The process of creating a form and storing its data into the database is mentioned as the next step in the app development process.', "The process of creating a new forms file called forms.py and defining a new class 'comment form' to represent an HTML form with attributes such as name and comment.", 'Instantiating the form in views and creating a context to pass the form to the template, allowing the display of the form in the HTML file.', "Handling post requests by modifying the method to be 'post', defining the form action, and adding cross-site request forgery token for security purposes.", 'Handling post requests in views, instantiating the form with request data, validating the form data, and creating a new row in the database using the form data.', 'Redirecting to the index upon form submission by using the redirect shortcut, enabling the form data to be added to the database and displayed in the guestbook page.']}], 'highlights': ['Django simplifies URL routing by eliminating the need to use regular expressions, making it more beginner-friendly.', 'Django provides a structured project organization, making it easier to scale code and understand for multiple developers.', 'Django 2.0 simplifies URL parameter passing by allowing the direct passing of a string, making it easier to match and direct users within the app.', 'The default Django admin dashboard provides tables for users and groups without additional code, enabling direct interface with models and database updates.', 'The process of creating a form and storing its data into the database is mentioned as the next step in the app development process.', 'Creating app functionalities step by step is emphasized, making it easier to achieve the desired app design and functionality.', 'The chapter introduces the Django web framework for Python and demonstrates building a simple guestbook application using Django.', 'Explaining the process of including URLs from a different app in Django and how to match requests based on the specified URLs', 'The process of creating views for the guest book and returning the index and sign templates in Django.', 'The process of creating URL patterns for the guest book and the inclusion of the guest book URLs in the project.']}