title
Getting Started With Django REST Framework

description
Easily build REST APIs Django using the Django REST Framework. In this video, I introduce the framework to you. Need one-on-one help with your project? I can help through my coaching program. Learn more here: https://prettyprinted.com/coaching Join my free course on building a Todo API with Django REST Framework: https://prettyprinted.com/djangotodoapi Get the code here: https://s3.us-east-2.amazonaws.com/prettyprinted/api_example.zip Twitter: https://twitter.com/pretty_printed Github: https://github.com/prettyprinted

detail
{'title': 'Getting Started With Django REST Framework', 'heatmap': [{'end': 496.067, 'start': 476.775, 'weight': 0.918}, {'end': 972.124, 'start': 948.987, 'weight': 0.855}, {'end': 1069.936, 'start': 1045.146, 'weight': 0.716}, {'end': 1161.478, 'start': 1097.222, 'weight': 0.859}, {'end': 1244.182, 'start': 1225.274, 'weight': 0.783}], 'summary': "Tutorial series on 'getting started with django rest framework' covers the installation process, creation of new projects and apps, database migration, use of modelviewset for api methods, and the creation of routers and api views, providing a comprehensive understanding of django rest framework.", 'chapters': [{'end': 98.854, 'segs': [{'end': 98.854, 'src': 'embed', 'start': 15.277, 'weight': 0, 'content': [{'end': 22.301, 'text': "So it makes sense if you're using Django and you want to build an API, then Django REST framework is something that you probably want to use.", 'start': 15.277, 'duration': 7.024}, {'end': 27.943, 'text': "So in this video I'm going to introduce it and then in future videos I'll cover more details about it.", 'start': 23.001, 'duration': 4.942}, {'end': 33.625, 'text': "But you'll see how easy it is to get something up and running with the Django REST framework in this video.", 'start': 28.023, 'duration': 5.602}, {'end': 36.265, 'text': 'So to start off I need to install it.', 'start': 34.365, 'duration': 1.9}, {'end': 42.387, 'text': "So let me go to my terminal and I'm going to install Django REST framework.", 'start': 36.706, 'duration': 5.681}, {'end': 47.309, 'text': 'So pip install Django REST framework.', 'start': 42.447, 'duration': 4.862}, {'end': 55.709, 'text': 'And I already have Django installed, of course, so this is going to take a moment to install and once it installs.', 'start': 48.82, 'duration': 6.889}, {'end': 58.893, 'text': "I'll be able to actually use it.", 'start': 57.792, 'duration': 1.101}, {'end': 64.881, 'text': "OK, so it's installed now and I'm just going to activate my virtual environment.", 'start': 60.436, 'duration': 4.445}, {'end': 76.049, 'text': "And now what I want to do is I want to start up a Django project, so I'm going to start project.", 'start': 69.062, 'duration': 6.987}, {'end': 79.613, 'text': "I'm going to call this API example so Django.", 'start': 76.149, 'duration': 3.464}, {'end': 85.719, 'text': "Dash admin start project and I'll call this API example.", 'start': 81.114, 'duration': 4.605}, {'end': 90.427, 'text': 'OK, so now that I have the API example project created,', 'start': 87.625, 'duration': 2.802}, {'end': 98.854, 'text': "I am going to navigate into that directory and I'm going to migrate the existing models that I have.", 'start': 90.427, 'duration': 8.427}], 'summary': 'Introducing django rest framework for building apis, installing and creating a project in this video.', 'duration': 83.577, 'max_score': 15.277, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc15277.jpg'}], 'start': 0.629, 'title': 'Django rest framework', 'summary': "Provides an introduction to django rest framework, covering its installation process and the creation of a new 'api example' project with existing models.", 'chapters': [{'end': 98.854, 'start': 0.629, 'title': 'Introduction to django rest framework', 'summary': "Introduces django rest framework as a tool to build apis for projects using django, demonstrating the installation process and creation of a new project named 'api example' with existing models.", 'duration': 98.225, 'highlights': ['Django REST framework is introduced as a tool to build APIs for projects using Django. The chapter emphasizes the use of Django REST framework for building APIs for projects using Django.', 'Demonstrates the installation process of Django REST framework using pip. The video demonstrates the installation of Django REST framework using the pip install command.', "Creation of a new project named 'API example' with existing models. The chapter shows the creation of a new project named 'API example' and the migration of existing models within the project."]}], 'duration': 98.225, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc629.jpg', 'highlights': ['Django REST framework is introduced as a tool to build APIs for projects using Django.', 'Demonstrates the installation process of Django REST framework using pip.', "Creation of a new project named 'API example' with existing models."]}, {'end': 419.983, 'segs': [{'end': 254.975, 'src': 'embed', 'start': 139.312, 'weight': 0, 'content': [{'end': 145.657, 'text': "I'm just using password one and this one has the P capitalized and still won't let me do it so.", 'start': 139.312, 'duration': 6.345}, {'end': 154.524, 'text': "I'm just trying to figure out my typical password for these things, so I don't forget, because, like these,", 'start': 147.399, 'duration': 7.125}, {'end': 158.968, 'text': "are just sample projects and I don't want to create real passwords, so I have to remember those.", 'start': 154.524, 'duration': 4.444}, {'end': 160.79, 'text': 'So I just create like a really simple.', 'start': 158.988, 'duration': 1.802}, {'end': 163.992, 'text': "Password, but what I'll do is.", 'start': 161.81, 'duration': 2.182}, {'end': 167.175, 'text': 'Create super user again.', 'start': 165.734, 'duration': 1.441}, {'end': 172.944, 'text': 'Username, Anthony, email address, anthonyatprettyprinted.com.', 'start': 168.763, 'duration': 4.181}, {'end': 181.946, 'text': "And then I'll call this secret11.", 'start': 173.884, 'duration': 8.062}, {'end': 188.427, 'text': 'Okay, so secret11 is the password with a capital S.', 'start': 184.867, 'duration': 3.56}, {'end': 190.948, 'text': 'Okay, now that I got that down, that was probably the hardest part of the app.', 'start': 188.427, 'duration': 2.521}, {'end': 197.561, 'text': "So what I'm going to do now is I'm going to create another app inside of this project or the first app.", 'start': 192.256, 'duration': 5.305}, {'end': 202.146, 'text': 'So python manage.py start app should be.', 'start': 197.962, 'duration': 4.184}, {'end': 206.009, 'text': 'And I want to create an app called languages.', 'start': 202.886, 'duration': 3.123}, {'end': 212.196, 'text': 'So this is basically going to be an API to return a list of languages and update a list of languages.', 'start': 206.41, 'duration': 5.786}, {'end': 216.62, 'text': 'Nothing complicated, but it is just an example project.', 'start': 212.616, 'duration': 4.004}, {'end': 220.736, 'text': 'So now I should have the folder here and I do.', 'start': 218.035, 'duration': 2.701}, {'end': 226.738, 'text': "So what I'm going to do is I'm going to add the relevant apps to my installed app.", 'start': 220.956, 'duration': 5.782}, {'end': 232.34, 'text': "So first I'm going to add the rest framework app because that's really important of course.", 'start': 227.178, 'duration': 5.162}, {'end': 235.821, 'text': "So it's just rest underscore framework as the app.", 'start': 232.7, 'duration': 3.121}, {'end': 240.663, 'text': "Then I'll add the app that I just created which is called languages.", 'start': 236.241, 'duration': 4.422}, {'end': 243.631, 'text': 'So language is just like that.', 'start': 242.17, 'duration': 1.461}, {'end': 248.993, 'text': 'And with that, that should be everything that I need for the settings.', 'start': 244.831, 'duration': 4.162}, {'end': 254.975, 'text': 'So now that I have the settings done, what I want to do is I want to..', 'start': 249.693, 'duration': 5.282}], 'summary': 'Creating a simple password, adding apps to project.', 'duration': 115.663, 'max_score': 139.312, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc139312.jpg'}], 'start': 98.954, 'title': 'Creating super user, new app, and languages api with django', 'summary': "Details the process of creating a super user, encountering issues with password creation, creating a new app within the project using 'python manage.py start app', and covers creating an app called languages with an api to return and update a list of programming languages and the process of setting up the app, editing urls, and creating a model for the api.", 'chapters': [{'end': 202.146, 'start': 98.954, 'title': 'Creating super user and starting new app', 'summary': "Details the process of creating a super user, encountering issues with password creation, and subsequently creating a new app within the project using 'python manage.py start app'.", 'duration': 103.192, 'highlights': ["Creating a super user using 'python manage.py create superuser' with the username Anthony and email address anthony@prettyprinted.com, setting the password as secret11 with a capital S.", "Encountering difficulty in setting a password for the super user, initially attempting 'password1' with a capitalized P and then opting for 'secret11' as the final choice.", "Initiating the creation of a new app within the project using the command 'python manage.py start app'."]}, {'end': 419.983, 'start': 202.886, 'title': 'Creating languages api with django', 'summary': 'Covers creating an app called languages with an api to return and update a list of programming languages and the process of setting up the app, editing urls, and creating a model for the api.', 'duration': 217.097, 'highlights': ["The chapter covers creating an app called languages with an API to return and update a list of programming languages. The app 'languages' is designed to serve as an API to return and update a list of programming languages, aiming to display languages like C, Python, JavaScript, and Ruby.", "The process of setting up the app, editing URLs, and creating a model for the API. The process includes adding relevant apps such as the rest framework app and the app 'languages' to the installed apps, editing the URLs, creating a model named 'language' with two columns, and migrating the model."]}], 'duration': 321.029, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc98954.jpg', 'highlights': ["Creating a super user using 'python manage.py create superuser' with the username Anthony and email address anthony@prettyprinted.com, setting the password as secret11 with a capital S.", "The chapter covers creating an app called languages with an API to return and update a list of programming languages. The app 'languages' is designed to serve as an API to return and update a list of programming languages, aiming to display languages like C, Python, JavaScript, and Ruby.", "Encountering difficulty in setting a password for the super user, initially attempting 'password1' with a capitalized P and then opting for 'secret11' as the final choice.", "The process of setting up the app, editing URLs, and creating a model for the API. The process includes adding relevant apps such as the rest framework app and the app 'languages' to the installed apps, editing the URLs, creating a model named 'language' with two columns, and migrating the model.", "Initiating the creation of a new app within the project using the command 'python manage.py start app'."]}, {'end': 856.593, 'segs': [{'end': 496.067, 'src': 'heatmap', 'start': 420.224, 'weight': 0, 'content': [{'end': 424.649, 'text': "So I'll use Python manage.py make migrations.", 'start': 420.224, 'duration': 4.425}, {'end': 427.93, 'text': "and then I'll migrate it.", 'start': 426.809, 'duration': 1.121}, {'end': 429.872, 'text': 'So migrates.', 'start': 428.09, 'duration': 1.782}, {'end': 434.477, 'text': 'And now that has been migrated.', 'start': 431.314, 'duration': 3.163}, {'end': 437.3, 'text': 'So it actually exists in my database.', 'start': 435.098, 'duration': 2.202}, {'end': 442.085, 'text': 'If I were to go to the admin dashboard, which I could do right now.', 'start': 437.64, 'duration': 4.445}, {'end': 445.929, 'text': 'So python manage.py run server.', 'start': 442.345, 'duration': 3.584}, {'end': 458.07, 'text': 'If I go to the admin dashboard, so slash admin, username is Anthony, password is secret11.', 'start': 448.922, 'duration': 9.148}, {'end': 466.977, 'text': 'I will be able to see that in my admin once I add it to the admin.', 'start': 460.692, 'duration': 6.285}, {'end': 469.159, 'text': 'So let me go to admin here.', 'start': 467.097, 'duration': 2.062}, {'end': 475.084, 'text': 'And then from.models import language.', 'start': 470.66, 'duration': 4.424}, {'end': 481.138, 'text': 'and then admin.site.register, and then pass in that model.', 'start': 476.775, 'duration': 4.363}, {'end': 482.879, 'text': 'So language, save that.', 'start': 481.198, 'duration': 1.681}, {'end': 485.26, 'text': 'And now when I refresh, I should see it.', 'start': 483.299, 'duration': 1.961}, {'end': 486.461, 'text': 'I see language is there.', 'start': 485.341, 'duration': 1.12}, {'end': 490.164, 'text': "And there's nothing in it, of course, because I haven't added anything.", 'start': 487.242, 'duration': 2.922}, {'end': 496.067, 'text': "And I'm not going to add anything through the admin dashboard because I want to use the API to take care of everything.", 'start': 490.904, 'duration': 5.163}], 'summary': 'Using python manage.py to migrate and add model to admin dashboard.', 'duration': 69.94, 'max_score': 420.224, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc420224.jpg'}, {'end': 541.558, 'src': 'embed', 'start': 514.863, 'weight': 3, 'content': [{'end': 528.435, 'text': 'What a serializer does in the context of an API is it translates to and from JSON or, Technically, it can be any format that you can send over HTTP,', 'start': 514.863, 'duration': 13.572}, {'end': 530.616, 'text': 'like XML or something like that.', 'start': 528.435, 'duration': 2.181}, {'end': 533.037, 'text': "But for our purposes, it's going to be JSON.", 'start': 531.016, 'duration': 2.021}, {'end': 541.558, 'text': 'So what I mean by this is, a JSON object is basically composed of the equivalent of lists and dictionaries.', 'start': 533.337, 'duration': 8.221}], 'summary': "A serializer translates data to/from json or other formats for api, such as xml, but for our purposes, it's json.", 'duration': 26.695, 'max_score': 514.863, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc514863.jpg'}, {'end': 763.904, 'src': 'embed', 'start': 737.057, 'weight': 4, 'content': [{'end': 740.58, 'text': 'So as you can imagine, the model for the serializer is going to be language.', 'start': 737.057, 'duration': 3.523}, {'end': 743.742, 'text': 'And the fields are the fields that I want to display.', 'start': 741.48, 'duration': 2.262}, {'end': 749.786, 'text': 'So I want to display an ID, which is something that comes when I import models.model.', 'start': 744.182, 'duration': 5.604}, {'end': 752.208, 'text': 'And I want to display the name and the paradigm.', 'start': 750.106, 'duration': 2.102}, {'end': 756.011, 'text': 'So this is just a tuple of all the columns that you want to display.', 'start': 752.828, 'duration': 3.183}, {'end': 759.735, 'text': 'So ID name and then paradigm just like that.', 'start': 756.332, 'duration': 3.403}, {'end': 763.904, 'text': "And then once I have that, I'm actually done with the serializer.", 'start': 761.343, 'duration': 2.561}], 'summary': 'Serializer model for language with id, name, and paradigm fields.', 'duration': 26.847, 'max_score': 737.057, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc737057.jpg'}, {'end': 826.077, 'src': 'embed', 'start': 802.311, 'weight': 5, 'content': [{'end': 810.098, 'text': 'So the views in this case can also be done very explicitly or you can take some shortcuts by just inheriting something.', 'start': 802.311, 'duration': 7.787}, {'end': 819.232, 'text': "so what i'm going to do is i'm going to import view sets from rest framework, so from rust framework import view sets,", 'start': 811.425, 'duration': 7.807}, {'end': 824.476, 'text': "and then i'm going to import both my model and the serializer that i just created.", 'start': 819.232, 'duration': 5.244}, {'end': 826.077, 'text': 'so from models,', 'start': 824.476, 'duration': 1.601}], 'summary': 'Importing view sets and models for explicit or shortcut views', 'duration': 23.766, 'max_score': 802.311, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc802311.jpg'}], 'start': 420.224, 'title': 'Database migration and api for serialization', 'summary': 'Covers using python manage.py for database migration, accessing the admin dashboard, and registering a model, along with using api for serialization, emphasizing the significance of serializer in translating data to and from json and inheriting view sets for creating views.', 'chapters': [{'end': 490.164, 'start': 420.224, 'title': 'Using python manage.py for database migration', 'summary': 'Explains the process of using python manage.py to make and perform database migrations, accessing the admin dashboard, and registering a model, resulting in the display of language in the admin dashboard.', 'duration': 69.94, 'highlights': ['The process of using Python manage.py to make and perform database migrations is demonstrated, ensuring that the data exists in the database.', "Accessing the admin dashboard using the command python manage.py runserver and logging in with the username 'Anthony' and the password 'secret11' is detailed.", "The method of registering a model 'language' and subsequently refreshing the admin dashboard to display the model is explained."]}, {'end': 856.593, 'start': 490.904, 'title': 'Using api for serialization and views', 'summary': 'Discusses using api for serialization and views, highlighting the importance of serializer in translating data to and from json and creating a model serializer, and inheriting view sets for creating views.', 'duration': 365.689, 'highlights': ['Serializer translates data to and from JSON or other formats for API usage, using lists and dictionaries from the request, with the model serializer providing functionality to create and update models. It also automatically translates JSON into the model.', 'Creating a model serializer is important for displaying relevant fields, such as ID, name, and paradigm, and handling the translation of JSON data into the model, eliminating the need for explicit translation code.', 'Inheriting view sets from the rest framework and linking them to the model and serializer simplifies the creation of views, providing shortcuts for creating explicit views.']}], 'duration': 436.369, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc420224.jpg', 'highlights': ['The process of using Python manage.py to make and perform database migrations is demonstrated, ensuring that the data exists in the database.', "Accessing the admin dashboard using the command python manage.py runserver and logging in with the username 'Anthony' and the password 'secret11' is detailed.", "The method of registering a model 'language' and subsequently refreshing the admin dashboard to display the model is explained.", 'Serializer translates data to and from JSON or other formats for API usage, using lists and dictionaries from the request, with the model serializer providing functionality to create and update models. It also automatically translates JSON into the model.', 'Creating a model serializer is important for displaying relevant fields, such as ID, name, and paradigm, and handling the translation of JSON data into the model, eliminating the need for explicit translation code.', 'Inheriting view sets from the rest framework and linking them to the model and serializer simplifies the creation of views, providing shortcuts for creating explicit views.']}, {'end': 1027.8, 'segs': [{'end': 977.668, 'src': 'heatmap', 'start': 941.561, 'weight': 0, 'content': [{'end': 948.326, 'text': "It will cover both the cases where you can get a list of all the objects, and it will cover the case where you're just getting a very specific object.", 'start': 941.561, 'duration': 6.765}, {'end': 954.811, 'text': "So this will make more sense when you actually see the API in action, but that's basically what the ModelViewSet is doing.", 'start': 948.987, 'duration': 5.824}, {'end': 961.857, 'text': 'Now that I have the views done, I can go on to the URLs.', 'start': 956.313, 'duration': 5.544}, {'end': 963.938, 'text': "I'll go back to my URLs file here.", 'start': 961.877, 'duration': 2.061}, {'end': 969.542, 'text': "What I want to do is I'm going to import the views module, so from.importViews.", 'start': 964.699, 'duration': 4.843}, {'end': 972.124, 'text': 'I have access to that language view that I just created.', 'start': 969.602, 'duration': 2.522}, {'end': 977.668, 'text': 'I also want to import something called routers from Rust Framework.', 'start': 973.305, 'duration': 4.363}], 'summary': 'The modelviewset covers listing all objects and specific objects. views and urls are being set up for api usage.', 'duration': 36.107, 'max_score': 941.561, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc941561.jpg'}], 'start': 856.593, 'title': 'Using modelviewset in django rest framework', 'summary': 'Discusses the simplification of handling standard rest api methods and automation of url generation using modelviewset in django rest framework, enabling easy retrieval and manipulation of database objects.', 'chapters': [{'end': 1027.8, 'start': 856.593, 'title': 'Using modelviewset in django rest framework', 'summary': 'Discusses the use of modelviewset in django rest framework, which simplifies handling standard rest api methods and automates url generation, enabling easy retrieval and manipulation of database objects.', 'duration': 171.207, 'highlights': ['ModelViewSet automates handling of standard REST API methods, simplifying the process and reducing the need for explicit handling of each case. ModelViewSet class simplifies handling standard REST API methods (GET, POST, PUT, DELETE) and automates the process, reducing the need for explicit handling of each case.', 'Inheriting ModelViewSet requires specifying only the methods for fetching objects from the database and the serializer class, simplifying the setup process. Inheriting ModelViewSet necessitates specifying only the methods for fetching objects from the database and the serializer class, simplifying the setup process.', 'ModelViewSet takes care of generating URLs for API endpoints, making it easier to perform standard operations such as retrieving all objects or creating new ones. ModelViewSet automates the generation of URLs for API endpoints, making it easier to perform standard operations such as retrieving all objects or creating new ones.']}], 'duration': 171.207, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc856593.jpg', 'highlights': ['ModelViewSet automates handling of standard REST API methods, simplifying the process and reducing the need for explicit handling of each case.', 'ModelViewSet takes care of generating URLs for API endpoints, making it easier to perform standard operations such as retrieving all objects or creating new ones.', 'Inheriting ModelViewSet necessitates specifying only the methods for fetching objects from the database and the serializer class, simplifying the setup process.']}, {'end': 1588.699, 'segs': [{'end': 1069.936, 'src': 'heatmap', 'start': 1045.146, 'weight': 0.716, 'content': [{'end': 1050.891, 'text': 'so router dot register, and the first argument is going to be the endpoint.', 'start': 1045.146, 'duration': 5.745}, {'end': 1055.235, 'text': 'so in this case i want my endpoints to be languages.', 'start': 1050.891, 'duration': 4.344}, {'end': 1064.201, 'text': 'and then the second argument is going to be the actual view for this, that the calling the url will send the request to.', 'start': 1055.235, 'duration': 8.966}, {'end': 1069.936, 'text': 'so views dot language view, just like that.', 'start': 1064.201, 'duration': 5.735}], 'summary': "Setting up a router dot register with 'languages' as the endpoint and 'language view' as the view.", 'duration': 24.79, 'max_score': 1045.146, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc1045146.jpg'}, {'end': 1123.545, 'src': 'embed', 'start': 1097.222, 'weight': 1, 'content': [{'end': 1105.113, 'text': 'Another nice thing that this does is it creates a nice HTML view for you, so you can visually see how your API is working,', 'start': 1097.222, 'duration': 7.891}, {'end': 1113.224, 'text': 'in addition to calling it using some kind of client application like Postman or curl, or whatever you use to perform requests.', 'start': 1105.113, 'duration': 8.111}, {'end': 1115.401, 'text': 'So that should be it.', 'start': 1114.52, 'duration': 0.881}, {'end': 1116.721, 'text': "Hopefully I didn't make any mistakes.", 'start': 1115.481, 'duration': 1.24}, {'end': 1123.545, 'text': "So my server restarted, but I'll just restart it just to make sure there are no errors.", 'start': 1117.502, 'duration': 6.043}], 'summary': 'The tool creates html view for api and allows visualization. server restarted to check for errors.', 'duration': 26.323, 'max_score': 1097.222, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc1097222.jpg'}, {'end': 1161.478, 'src': 'heatmap', 'start': 1097.222, 'weight': 0.859, 'content': [{'end': 1105.113, 'text': 'Another nice thing that this does is it creates a nice HTML view for you, so you can visually see how your API is working,', 'start': 1097.222, 'duration': 7.891}, {'end': 1113.224, 'text': 'in addition to calling it using some kind of client application like Postman or curl, or whatever you use to perform requests.', 'start': 1105.113, 'duration': 8.111}, {'end': 1115.401, 'text': 'So that should be it.', 'start': 1114.52, 'duration': 0.881}, {'end': 1116.721, 'text': "Hopefully I didn't make any mistakes.", 'start': 1115.481, 'duration': 1.24}, {'end': 1123.545, 'text': "So my server restarted, but I'll just restart it just to make sure there are no errors.", 'start': 1117.502, 'duration': 6.043}, {'end': 1124.986, 'text': "So I don't see any errors.", 'start': 1123.966, 'duration': 1.02}, {'end': 1134.332, 'text': "So what I'm going to do is I'm going to go to my index and hopefully I'll get to see the default page for my API.", 'start': 1125.687, 'duration': 8.645}, {'end': 1137.594, 'text': 'And this page should be generated by that default router.', 'start': 1134.392, 'duration': 3.202}, {'end': 1140.636, 'text': 'So click there and I see it here.', 'start': 1138.354, 'duration': 2.282}, {'end': 1147.26, 'text': 'So I see something called the API root and here I see what I have available to look at.', 'start': 1141.136, 'duration': 6.124}, {'end': 1151.082, 'text': 'So I see languages here and it gives me a URL for languages.', 'start': 1147.36, 'duration': 3.722}, {'end': 1157.937, 'text': "So if I just click that, I see which should be a list of languages, but I don't see anything.", 'start': 1151.182, 'duration': 6.755}, {'end': 1161.478, 'text': "and that's expected because I don't have any languages in the database.", 'start': 1157.937, 'duration': 3.541}], 'summary': 'The speaker visually views api in html. server restarted, no errors found. default page generated by default router.', 'duration': 64.256, 'max_score': 1097.222, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc1097222.jpg'}, {'end': 1256.997, 'src': 'heatmap', 'start': 1225.274, 'weight': 0.783, 'content': [{'end': 1227.235, 'text': 'Models to actually return.', 'start': 1225.274, 'duration': 1.961}, {'end': 1230.096, 'text': "So I think it's stir.", 'start': 1228.635, 'duration': 1.461}, {'end': 1237.679, 'text': 'And then return self dot name just so we can see the name here and then refresh this.', 'start': 1231.636, 'duration': 6.043}, {'end': 1240.1, 'text': 'OK, I see C in Java.', 'start': 1238.239, 'duration': 1.861}, {'end': 1244.182, 'text': "So I didn't add those through the admin dashboard.", 'start': 1241.441, 'duration': 2.741}, {'end': 1247.223, 'text': 'I added them through the API by performing a post request.', 'start': 1244.242, 'duration': 2.981}, {'end': 1256.997, 'text': "And if I go to something like postman and type in my URL, so it's going to be one, two, seven, 8,000 slash languages.", 'start': 1248.729, 'duration': 8.268}], 'summary': 'Models returned through api post request for languages at url 127.0.0.1:8000/languages.', 'duration': 31.723, 'max_score': 1225.274, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc1225274.jpg'}, {'end': 1387.154, 'src': 'embed', 'start': 1355.451, 'weight': 0, 'content': [{'end': 1358.594, 'text': 'but for now anybody can add things into the database.', 'start': 1355.451, 'duration': 3.143}, {'end': 1365.895, 'text': "So now, like I said, the router will generate the URLs for both the list view, which I'm looking at now, and the detail view.", 'start': 1359.847, 'duration': 6.048}, {'end': 1370.04, 'text': 'So the detail view is just, you know, the endpoint slash the ID.', 'start': 1366.075, 'duration': 3.965}, {'end': 1374.886, 'text': 'So if I go to like slash two, then it gives me the language instance.', 'start': 1370.22, 'duration': 4.666}, {'end': 1376.509, 'text': "And it's telling me that this is the.", 'start': 1375.027, 'duration': 1.482}, {'end': 1381.609, 'text': 'result for a C and I can modify this here.', 'start': 1378.286, 'duration': 3.323}, {'end': 1387.154, 'text': 'So if I put procedurals and hit put, then it changes that procedural to procedural rules.', 'start': 1382.29, 'duration': 4.864}], 'summary': 'The router generates urls for list view and detail view, allowing modification of language instances.', 'duration': 31.703, 'max_score': 1355.451, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc1355451.jpg'}, {'end': 1452.686, 'src': 'embed', 'start': 1404.045, 'weight': 3, 'content': [{'end': 1409.072, 'text': 'So as you can see, Django rest framework did a lot for us with very little code.', 'start': 1404.045, 'duration': 5.027}, {'end': 1416.862, 'text': 'I really beyond my model, which is pretty standard, I only added the serializer, which is what four lines of code.', 'start': 1409.272, 'duration': 7.59}, {'end': 1421.148, 'text': 'And then I had to use the model view set and.', 'start': 1417.222, 'duration': 3.926}, {'end': 1429.151, 'text': "it's three lines of code and they have different types of serializers and different types of view sets.", 'start': 1422.785, 'duration': 6.366}, {'end': 1435.196, 'text': 'Like, for instance, if I wanted this to be a hyper linked model view set.', 'start': 1429.211, 'duration': 5.985}, {'end': 1440.481, 'text': "what this is going to do is it's going to allow me to see the actual URL for the resource that gets returned.", 'start': 1435.196, 'duration': 5.285}, {'end': 1447.084, 'text': 'So, Instead of seeing ID one, I can say something like, you know, show me the URL for this resource instead.', 'start': 1441.001, 'duration': 6.083}, {'end': 1452.686, 'text': "So I'll go back to my serializer and instead of returning the ID, I can return the URL.", 'start': 1447.604, 'duration': 5.082}], 'summary': 'Django rest framework simplified development with minimal code, e.g., 4 lines for serializer and 3 lines for model view set, offering flexibility with different types of serializers and view sets.', 'duration': 48.641, 'max_score': 1404.045, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc1404045.jpg'}, {'end': 1515.936, 'src': 'embed', 'start': 1487.915, 'weight': 5, 'content': [{'end': 1493.401, 'text': 'I can have both the ID and the URL if I just add the ID to the fields if I want.', 'start': 1487.915, 'duration': 5.486}, {'end': 1497.787, 'text': 'So ID, URL, name, and paradigm.', 'start': 1493.482, 'duration': 4.305}, {'end': 1501.429, 'text': 'and I see ID one.', 'start': 1500.228, 'duration': 1.201}, {'end': 1502.369, 'text': "Here's the URL.", 'start': 1501.569, 'duration': 0.8}, {'end': 1509.033, 'text': "I can simply click on it because it's a link and it returns the detail for that particular thing in the database.", 'start': 1502.409, 'duration': 6.624}, {'end': 1515.936, 'text': 'So as you can see, using Django rest framework is really easy to do, and if you have a very standard.', 'start': 1509.813, 'duration': 6.123}], 'summary': 'Using django rest framework is easy, can access id and url.', 'duration': 28.021, 'max_score': 1487.915, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc1487915.jpg'}], 'start': 1028.48, 'title': 'Creating routers and api views', 'summary': 'Explains the process of creating a router to generate urls, registering views, and interacting with the api, with a demonstration of adding, retrieving, updating, and deleting data from the database. it also introduces django rest framework, showcasing its ease of use and minimal code requirements, with examples of implementing serializers and view sets for creating apis.', 'chapters': [{'end': 1402.788, 'start': 1028.48, 'title': 'Creating router and api view', 'summary': 'Explains the process of creating a router to generate urls and registering views, resulting in the ability to interact with the api through both a front-end browser and a client application, with the demonstration of adding, retrieving, updating, and deleting data from the database.', 'duration': 374.308, 'highlights': ['The router generates URLs for both the list view and the detail view, allowing interaction with the API through a front-end browser and a client application. The router generates URLs for both the list view and the detail view, enabling interaction with the API through different platforms.', 'Demonstration of adding, retrieving, updating, and deleting data from the database using the API. The transcript demonstrates the process of adding, retrieving, updating, and deleting data from the database using the API.', 'Interaction with the API through a front-end browser and a client application like Postman, with the ability to retrieve data in JSON format when using a client application. The API can be interacted with through both a front-end browser and a client application like Postman, providing the ability to retrieve data in JSON format when using a client application.']}, {'end': 1588.699, 'start': 1404.045, 'title': 'Introduction to django rest framework', 'summary': 'Introduces django rest framework, showcasing its ease of use and minimal code requirements, with examples of implementing different types of serializers and view sets for creating apis.', 'duration': 184.654, 'highlights': ['Django REST Framework provides a streamlined approach for building APIs with minimal code requirements, as demonstrated by the addition of serializers and view sets with just a few lines of code. The speaker highlights the simplicity of using Django REST Framework, as it only requires a few lines of code to add serializers and view sets, showcasing its ease of use and minimal code requirements.', 'Different types of serializers, such as hyperlinked model serializer, can be utilized to customize the API output, enabling the display of resource URLs instead of IDs. The speaker demonstrates the use of a hyperlinked model serializer to customize the API output, allowing the display of resource URLs instead of IDs, showcasing the flexibility of Django REST Framework.', 'Customization of the API can be achieved by adding fields to the serializer, such as ID, URL, name, and paradigm, providing control over the data displayed in the API responses. The speaker explains the process of customizing the API by adding fields to the serializer, including ID, URL, name, and paradigm, demonstrating the flexibility and control offered by Django REST Framework.']}], 'duration': 560.219, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/263xt_4mBNc/pics/263xt_4mBNc1028480.jpg', 'highlights': ['The router generates URLs for both the list view and the detail view, enabling interaction with the API through different platforms.', 'Demonstration of adding, retrieving, updating, and deleting data from the database using the API.', 'Interaction with the API through a front-end browser and a client application like Postman, providing the ability to retrieve data in JSON format when using a client application.', 'The speaker highlights the simplicity of using Django REST Framework, as it only requires a few lines of code to add serializers and view sets, showcasing its ease of use and minimal code requirements.', 'The speaker demonstrates the use of a hyperlinked model serializer to customize the API output, allowing the display of resource URLs instead of IDs, showcasing the flexibility of Django REST Framework.', 'The speaker explains the process of customizing the API by adding fields to the serializer, including ID, URL, name, and paradigm, demonstrating the flexibility and control offered by Django REST Framework.']}], 'highlights': ['The speaker explains the process of customizing the API by adding fields to the serializer, including ID, URL, name, and paradigm, demonstrating the flexibility and control offered by Django REST Framework.', 'Interaction with the API through a front-end browser and a client application like Postman, providing the ability to retrieve data in JSON format when using a client application.', 'The process of using Python manage.py to make and perform database migrations is demonstrated, ensuring that the data exists in the database.', 'Inheriting view sets from the rest framework and linking them to the model and serializer simplifies the creation of views, providing shortcuts for creating explicit views.', 'ModelViewSet automates handling of standard REST API methods, simplifying the process and reducing the need for explicit handling of each case.']}