title
Django Rest Framework | How to Create a RESTful API Using Django | Django Tutorial | Edureka

description
🔥 Python Django Training (Use Code "𝐘𝐎𝐔𝐓𝐔𝐁𝐄𝟐𝟎"): https://www.edureka.co/python-django This Edureka “Django Rest Framework tutorial" introduces you to the concepts of API and will helps you build a successful REST API in Django. This video helps you to learn following topics: 1. What is an API? 2. Introduction to Rest Framework 3. What is Rest API? 4. Demo - Create a RESTful Web APi Subscribe to our channel to get video updates. Hit the subscribe button above. Check out our Django Training Playlist: https://goo.gl/icG4qG #Django #djangorestframework #djangoAPI #pythondjango #djangoforbeginners #pythonprogramming #python #djangotutorial How it Works? 1. This is a 5 Week Instructor led Online Course,40 hours of assignment and 20 hours of project work 2. We have a 24x7 One-on-One LIVE Technical Support to help you with any problems you might face or any clarifications you may require during the course. 3. At the end of the training you will be working on a real time project for which we will provide you a Grade and a Verifiable Certificate! It will a live project where you shall create a web application using the Django framework. - - - - - - - - - - - - - - - - - About the Course Edureka's Python Django Training and Certification course is intended to help the learner obtain proficiency in Python programming and develop real-world web applications using Django. This course will cover both the basics and the advanced concepts like writing Python scripts, file operations in Python, working with Databases, creating Views, Templates, Forms, Models and REST APIs in Django. - - - - - - - - - - - - - - - - - - - Why learn Python Django? Django, a popular & high level python web framework, is Flat out amazing. Below are few of the reasons. Instagram, Facebook, Disqus, Pinterest, NASA, The Washington Post and other top companies use Python with Django. For web developers, this means that mastering Python and its popular advanced frameworks like Django should ensure you’re able to find work or even build your own product or service as a startup. Python is an ideal option for bootstrappers and startups because of its quick deployment and—as mentioned earlier—lesser amount of required code next to Java, C, and PHP among others. Python Django framework supports the use of human-readable website URLs, which isn’t only helpful from the actual user’s perspective, but also to search engines, which use the keywords in the URL when ranking sites. Django prevents a number of common security mistakes better than say, PHP does. Moreover, average salary of a Django professional is $117,000 / year in US alone as reported by Indeed.com For more information, please write back to us at sales@edureka.co Call us at US: 1844 230 6362(toll free) or India: +91-90660 20867 Facebook: https://www.facebook.com/edurekaIN/ Twitter: https://twitter.com/edurekain LinkedIn: https://www.linkedin.com/company/edureka

detail
{'title': 'Django Rest Framework | How to Create a RESTful API Using Django | Django Tutorial | Edureka', 'heatmap': [{'end': 581.904, 'start': 552.744, 'weight': 0.825}, {'end': 956.705, 'start': 925.237, 'weight': 0.845}, {'end': 1166.398, 'start': 1148.145, 'weight': 0.832}, {'end': 1233.637, 'start': 1216.175, 'weight': 0.776}, {'end': 1276.7, 'start': 1258.552, 'weight': 0.708}], 'summary': 'Tutorial series provides a practical guide to building restful apis using django rest framework, covering topics such as architecture, common http methods, installation, creating django rest applications, json and python serializers, and creating a fully functional restful api in django.', 'chapters': [{'end': 127.384, 'segs': [{'end': 27.292, 'src': 'embed', 'start': 0.089, 'weight': 0, 'content': [{'end': 4.873, 'text': "Hello everyone, this is Ayushi from Edureka and today we're gonna talk about Django REST Framework.", 'start': 0.089, 'duration': 4.784}, {'end': 8.016, 'text': "So without wasting any more time, let's look at today's agenda.", 'start': 5.433, 'duration': 2.583}, {'end': 10.818, 'text': "So today's session is mainly a practical session.", 'start': 8.556, 'duration': 2.262}, {'end': 15.522, 'text': 'But before we begin the practical aspect, there is some amount of theoretical knowledge that you need to have.', 'start': 11.198, 'duration': 4.324}, {'end': 21.347, 'text': 'So we begin the session by first understanding what is an API and how an API fits into Django.', 'start': 16.122, 'duration': 5.225}, {'end': 27.292, 'text': "After that we'll have a brief introduction to REST Framework and what exactly is REST API and how does it work.", 'start': 21.827, 'duration': 5.465}], 'summary': 'Ayushi from edureka discusses practical and theoretical aspects of django rest framework, including api and rest api concepts.', 'duration': 27.203, 'max_score': 0.089, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI89.jpg'}, {'end': 87.11, 'src': 'embed', 'start': 55.275, 'weight': 1, 'content': [{'end': 57.115, 'text': 'So all these comes under your application.', 'start': 55.275, 'duration': 1.84}, {'end': 58.776, 'text': 'Next is your programming.', 'start': 57.776, 'duration': 1}, {'end': 64.236, 'text': 'So programming is basically a set of instructions that you tell a computer to perform a specific task.', 'start': 59.116, 'duration': 5.12}, {'end': 69.078, 'text': 'Now using that program you can build a software which makes the life much easier.', 'start': 64.876, 'duration': 4.202}, {'end': 71.219, 'text': 'So that is what programming is.', 'start': 69.838, 'duration': 1.381}, {'end': 72.9, 'text': 'Last is your interface.', 'start': 71.819, 'duration': 1.081}, {'end': 79.445, 'text': 'Now an interface is a point where two applications, or you can say programs, meet and interact with each other.', 'start': 73.34, 'duration': 6.105}, {'end': 82.487, 'text': 'Now it basically allows to communicate with one another.', 'start': 80.025, 'duration': 2.462}, {'end': 87.11, 'text': 'And hence API is a way for programmers to communicate with various applications.', 'start': 82.507, 'duration': 4.603}], 'summary': 'Programming is a set of instructions for computers to perform tasks, leading to software development and api usage for interaction between applications.', 'duration': 31.835, 'max_score': 55.275, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI55275.jpg'}], 'start': 0.089, 'title': 'Django rest framework', 'summary': 'Introduces the practical guide to building restful apis using django rest framework, covering the agenda, theoretical knowledge, api understanding, and communication with various applications.', 'chapters': [{'end': 127.384, 'start': 0.089, 'title': 'Django rest framework: practical guide to building restful apis', 'summary': 'Introduces django rest framework, covering topics such as the practical session agenda, theoretical knowledge required, understanding api, its components, and how it allows programmers to communicate with various applications.', 'duration': 127.295, 'highlights': ['The chapter introduces Django REST Framework and its practical session agenda. The chapter starts with a practical session agenda focusing on theoretical knowledge required and understanding API.', 'An API is explained as an application programming interface, comprising application, programming, and interface components. An API is broken down into application, programming, and interface components, allowing programmers to communicate with various applications.', 'The components of an API, including application, programming, and interface, are detailed with examples. The components of an API are explained with examples, such as smartphone applications and computer programming.']}], 'duration': 127.295, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI89.jpg', 'highlights': ['The chapter introduces Django REST Framework and its practical session agenda.', 'An API is explained as an application programming interface, comprising application, programming, and interface components.', 'The components of an API, including application, programming, and interface, are detailed with examples.']}, {'end': 285.539, 'segs': [{'end': 156.402, 'src': 'embed', 'start': 128.084, 'weight': 0, 'content': [{'end': 131.786, 'text': 'Now let us move on to our next topic that is an introduction to REST framework.', 'start': 128.084, 'duration': 3.702}, {'end': 137.129, 'text': 'So REST basically describes an architecture which stands for Representational State Transform.', 'start': 132.406, 'duration': 4.723}, {'end': 140.791, 'text': 'It is used for the purpose of web APIs for data communication.', 'start': 137.729, 'duration': 3.062}, {'end': 147.255, 'text': 'It also supports some of the common HTTP methods to make interaction between the machines or you can say applications.', 'start': 141.451, 'duration': 5.804}, {'end': 154.06, 'text': 'Now some of the HTTP methods that are commonly used in REST architecture are get, put, post and delete.', 'start': 147.975, 'duration': 6.085}, {'end': 156.402, 'text': 'So the very first method is get.', 'start': 154.781, 'duration': 1.621}], 'summary': 'Introduction to rest framework for web apis, supporting common http methods for interaction between machines or applications.', 'duration': 28.318, 'max_score': 128.084, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI128084.jpg'}], 'start': 128.084, 'title': 'Introduction to rest framework', 'summary': 'Introduces rest framework, explaining its architecture, common http methods (get, put, post, delete), and the usage of restful apis, emphasizing its universality and efficiency in data communication for web services and applications.', 'chapters': [{'end': 285.539, 'start': 128.084, 'title': 'Introduction to rest framework', 'summary': 'Introduces rest framework, explaining its architecture, common http methods (get, put, post, delete), and the usage of restful apis, emphasizing its universality and efficiency in data communication for web services and applications.', 'duration': 157.455, 'highlights': ['REST architecture is used for web APIs for data communication and supports common HTTP methods such as GET, PUT, POST, and DELETE. It describes an architecture for web APIs and supports common HTTP methods such as GET, PUT, POST, and DELETE, enabling interaction between machines or applications.', 'Commonly used HTTP methods in REST architecture are GET, PUT, POST, and DELETE, each serving specific purposes. Commonly used HTTP methods in REST architecture are GET (for retrieving records), PUT (for updating resources), POST (for creating resources), and DELETE (for removing resources).', 'RESTful APIs, used by services like Facebook, Google, and Twitter, enable data communication universally for web services and applications. Web services using REST architecture are called RESTful APIs, enabling universal data communication for web services and applications, exemplified by services like Facebook, Google, and Twitter.', 'Creating a RESTful API allows universal data communication in a common format like JSON, reducing code duplication and size. Creating a RESTful API allows universal data communication in a common format like JSON, reducing code duplication and size while serving various platforms (e.g., Android, iOS, etc.).']}], 'duration': 157.455, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI128084.jpg', 'highlights': ['RESTful APIs enable universal data communication for web services and applications, exemplified by services like Facebook, Google, and Twitter.', 'Creating a RESTful API allows universal data communication in a common format like JSON, reducing code duplication and size while serving various platforms (e.g., Android, iOS, etc.).', 'Commonly used HTTP methods in REST architecture are GET (for retrieving records), PUT (for updating resources), POST (for creating resources), and DELETE (for removing resources).', 'REST architecture is used for web APIs for data communication and supports common HTTP methods such as GET, PUT, POST, and DELETE, enabling interaction between machines or applications.']}, {'end': 759.57, 'segs': [{'end': 335.455, 'src': 'embed', 'start': 305.783, 'weight': 0, 'content': [{'end': 310.764, 'text': 'Now, once your installation is done, you need to add this framework in your installed application.', 'start': 305.783, 'duration': 4.981}, {'end': 314.846, 'text': 'So let me go back to my project and explain you how practically it is done.', 'start': 311.325, 'duration': 3.521}, {'end': 317.326, 'text': 'So first of all, let us create a project.', 'start': 315.626, 'duration': 1.7}, {'end': 321.267, 'text': 'So I am in my C drive, users, Aayushi and MyJump projects.', 'start': 317.726, 'duration': 3.541}, {'end': 326.449, 'text': 'So here I create a new folder by calling it by Django rest framework.', 'start': 322.028, 'duration': 4.421}, {'end': 330.59, 'text': "And inside this, we'll be creating a project.", 'start': 328.589, 'duration': 2.001}, {'end': 335.455, 'text': "So let me go to my command prompt and I'll give this location.", 'start': 331.272, 'duration': 4.183}], 'summary': 'To add django rest framework, create a project in specified location.', 'duration': 29.672, 'max_score': 305.783, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI305783.jpg'}, {'end': 551.203, 'src': 'embed', 'start': 517.216, 'weight': 2, 'content': [{'end': 520.256, 'text': 'So here let me fill in some details for the employee class.', 'start': 517.216, 'duration': 3.04}, {'end': 524.618, 'text': "Let's say your first name of the employee or the last name or some employee ID to it.", 'start': 520.597, 'duration': 4.021}, {'end': 527.019, 'text': 'So let me feed in some details to it.', 'start': 525.158, 'duration': 1.861}, {'end': 534.801, 'text': "But I'll mention the max length to say 10.", 'start': 531.12, 'duration': 3.681}, {'end': 536.501, 'text': 'Next is my last name attribute.', 'start': 534.801, 'duration': 1.7}, {'end': 544.356, 'text': 'Again, max length should be 10.', 'start': 541.914, 'duration': 2.442}, {'end': 549.061, 'text': "And let's say one more field I want to feed in, say employee ID.", 'start': 544.356, 'duration': 4.705}, {'end': 551.203, 'text': 'This should be an integer field.', 'start': 550.122, 'duration': 1.081}], 'summary': 'Details for the employee class: first name, last name, and employee id with max length of 10, and employee id as an integer field', 'duration': 33.987, 'max_score': 517.216, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI517216.jpg'}, {'end': 581.904, 'src': 'heatmap', 'start': 552.744, 'weight': 0.825, 'content': [{'end': 555.186, 'text': "Next what we'll have, we'll have a string representation of this.", 'start': 552.744, 'duration': 2.442}, {'end': 559.09, 'text': "So here what I'll be doing, I'll be creating a method that returns all your fields.", 'start': 555.587, 'duration': 3.503}, {'end': 564.575, 'text': 'And it returns, say self.firstName.', 'start': 561.312, 'duration': 3.263}, {'end': 571.715, 'text': 'Next what can I do, I can go to my admin.py file.', 'start': 568.632, 'duration': 3.083}, {'end': 575.438, 'text': 'Now here I can add and delete employees from the admin panel.', 'start': 572.335, 'duration': 3.103}, {'end': 579.462, 'text': 'So for that we need to first import the model that we just created.', 'start': 576.199, 'duration': 3.263}, {'end': 581.904, 'text': 'So here my admin is imported.', 'start': 580.222, 'duration': 1.682}], 'summary': 'Creating a method to return all fields and managing employees in admin panel.', 'duration': 29.16, 'max_score': 552.744, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI552744.jpg'}], 'start': 286.28, 'title': 'Installing and creating django rest applications', 'summary': 'Covers the installation of django rest framework using python package manager and creating a django rest application using pycharm. it includes steps for installation, project setup, creating a model, configuring project settings, accessing the admin panel, and demonstrating adding and viewing employee details.', 'chapters': [{'end': 375.618, 'start': 286.28, 'title': 'Installing django rest framework', 'summary': 'Explains the process of installing django rest framework using python package manager, including steps for installation and project setup.', 'duration': 89.338, 'highlights': ['The process of installing Django Rest Framework using Python package manager is explained, including using command line and PyCharm for installation. The chapter describes the process of installing Django Rest Framework using Python package manager, with specific instructions for command line and PyCharm installation.', 'The steps for creating a project and adding the framework to the installed application are detailed. The chapter outlines the steps for creating a project and adding the Django Rest Framework to the installed application.', 'The specific commands for creating a project and navigating through the project files are provided. Specific commands for creating a project and navigating through the project files are detailed in the chapter.']}, {'end': 759.57, 'start': 376.298, 'title': 'Creating django rest application', 'summary': 'Explains the process of creating a django rest application using pycharm, including installing the framework, setting up project and application, creating a model, configuring project settings, and accessing the admin panel, with a demonstration of adding and viewing employee details through the admin page.', 'duration': 383.272, 'highlights': ['The chapter explains the process of creating a Django REST application using PyCharm, including installing the framework, setting up project and application, creating a model, configuring project settings, and accessing the admin panel. It covers the step-by-step process of creating a Django REST application using PyCharm, highlighting the key actions involved in setting up the project and application, creating a model, configuring project settings, and accessing the admin panel.', 'Demonstration of adding and viewing employee details through the admin page. It demonstrates the functionality of adding and viewing employee details through the admin page, showcasing the process of adding employee information and accessing necessary details like first name, last name, and employee ID.', "Installation and verification of Django REST framework using pip and terminal commands. It explains the process of installing the Django REST framework using 'pip install' command, and highlights the verification of the installation, showcasing the use of terminal commands for these actions."]}], 'duration': 473.29, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI286280.jpg', 'highlights': ['The process of installing Django Rest Framework using Python package manager is explained, including using command line and PyCharm for installation.', 'The chapter explains the process of creating a Django REST application using PyCharm, including installing the framework, setting up project and application, creating a model, configuring project settings, and accessing the admin panel.', 'Demonstration of adding and viewing employee details through the admin page.']}, {'end': 1026.084, 'segs': [{'end': 787.946, 'src': 'embed', 'start': 760.01, 'weight': 1, 'content': [{'end': 763.632, 'text': "Now while going back to it, you'll see again the list of the employees.", 'start': 760.01, 'duration': 3.622}, {'end': 767.014, 'text': 'Now let me go back to my code and see what else we have to do.', 'start': 764.152, 'duration': 2.862}, {'end': 769.713, 'text': 'Now let us create a serializer class.', 'start': 767.952, 'duration': 1.761}, {'end': 773.816, 'text': 'Now this class is used to convert your model to your JSON data.', 'start': 770.214, 'duration': 3.602}, {'end': 779.5, 'text': "So JSON as I've already told you, JSON is a format and it is not at all specific to any application.", 'start': 774.236, 'duration': 5.264}, {'end': 787.946, 'text': 'Now JSON is used because whenever a user requests a website, we usually send them back a regular old HTML format or HTML response.', 'start': 780.181, 'duration': 7.765}], 'summary': 'Creating a serializer class to convert model to json data for website responses.', 'duration': 27.936, 'max_score': 760.01, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI760010.jpg'}, {'end': 861.247, 'src': 'embed', 'start': 830.475, 'weight': 2, 'content': [{'end': 834.097, 'text': 'So class employee followed by a serializer.', 'start': 830.475, 'duration': 3.622}, {'end': 843.901, 'text': 'Serializers So here this is my model name which is my employees followed by a serializer.', 'start': 834.117, 'duration': 9.784}, {'end': 849.244, 'text': 'So whatever model you wanna serialize, just say the name of the class followed by a serializer keyword.', 'start': 844.221, 'duration': 5.023}, {'end': 853.702, 'text': 'Next this serializers dot model serializer is your inbuilt thing.', 'start': 850.02, 'duration': 3.682}, {'end': 861.247, 'text': "You don't have to worry about this because you just have your model as a blueprint which the serializer needs to convert to a JSON format.", 'start': 854.023, 'duration': 7.224}], 'summary': 'Using serializers to convert employee model to json format.', 'duration': 30.772, 'max_score': 830.475, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI830475.jpg'}, {'end': 973.497, 'src': 'heatmap', 'start': 925.237, 'weight': 0, 'content': [{'end': 928.64, 'text': 'So now it will display your first name, last name and employee name.', 'start': 925.237, 'duration': 3.403}, {'end': 932.384, 'text': "So I have done this because I don't have much fields to return.", 'start': 929.241, 'duration': 3.143}, {'end': 934.045, 'text': "That's why I've written all.", 'start': 932.764, 'duration': 1.281}, {'end': 939.11, 'text': 'Next let us go to the views.py file and see what we need to display when we hit the API.', 'start': 934.826, 'duration': 4.284}, {'end': 941.532, 'text': 'So this is my views.py file.', 'start': 939.95, 'duration': 1.582}, {'end': 946.962, 'text': 'So in this file, what we have to do, we have to just request an API and get the JSON back.', 'start': 942.321, 'duration': 4.641}, {'end': 949.663, 'text': 'For that, first of all, you need some inputs.', 'start': 947.783, 'duration': 1.88}, {'end': 951.203, 'text': "So I've already copied them.", 'start': 950.103, 'duration': 1.1}, {'end': 952.744, 'text': 'So let me just paste it over here.', 'start': 951.424, 'duration': 1.32}, {'end': 953.944, 'text': 'This saves my time.', 'start': 953.024, 'duration': 0.92}, {'end': 956.705, 'text': "Now don't worry, I'll explain each one of them.", 'start': 954.844, 'duration': 1.861}, {'end': 958.946, 'text': 'So the very first is by default.', 'start': 957.285, 'duration': 1.661}, {'end': 963.807, 'text': 'Next is your HTTP response, which you have been using for any program to return the response.', 'start': 959.506, 'duration': 4.301}, {'end': 967.614, 'text': 'Next is your get object or 404.', 'start': 964.753, 'duration': 2.861}, {'end': 973.497, 'text': "Now, if we get 404, when the object doesn't exist, say, for example, you request some random name, let's say Amit,", 'start': 967.614, 'duration': 5.883}], 'summary': 'Code review: views.py file requests api and returns json with default and http response settings.', 'duration': 48.26, 'max_score': 925.237, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI925237.jpg'}], 'start': 760.01, 'title': 'Creating json and python serializers', 'summary': 'Discusses the creation of a serializer class to convert a model to json data, explaining the need for using json format instead of html and its application in responding to user requests. it also covers creating python serializers to convert a model into json, configuring fields, and handling http responses in an api view.', 'chapters': [{'end': 800.775, 'start': 760.01, 'title': 'Creating json serializer class', 'summary': 'Discusses the creation of a serializer class to convert a model to json data, explaining the need for using json format instead of html and its application in responding to user requests.', 'duration': 40.765, 'highlights': ['The serializer class is used to convert a model to JSON data, which is necessary for responding to user requests with JSON instead of HTML.', 'JSON is used to respond to user requests with JSON instead of HTML, as it is the format for information sent back to the browser.', 'The need for a serializer arises from the requirement to convert a model to JSON for sending JSON instead of HTML in response to user requests.']}, {'end': 1026.084, 'start': 801.416, 'title': 'Creating python serializers', 'summary': 'Covers creating python serializers to convert a model into json, configuring fields, and handling http responses in an api view.', 'duration': 224.668, 'highlights': ["You can create a class meta to configure the fields used in the employee model, such as first name and last name, or use fields = '__all__' to return all fields. Explains how to configure fields for the employee model in the class meta, allowing the selection of specific fields or returning all fields.", 'The API view is used to return an API data, and the response can include status codes such as 200 for success and 404 for not found. Describes the usage of API view to return data and the response status codes like 200 for success and 404 for not found.', 'Importing necessary modules from the rest framework and creating a class for the employee serializer to convert the model to JSON format. Covers the import of modules from the rest framework and the creation of a class for the employee serializer to convert the model to JSON format.']}], 'duration': 266.074, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI760010.jpg', 'highlights': ['The serializer class is used to convert a model to JSON data, necessary for responding to user requests with JSON instead of HTML.', "You can create a class meta to configure the fields used in the employee model, such as first name and last name, or use fields = '__all__' to return all fields.", 'The API view is used to return an API data, and the response can include status codes such as 200 for success and 404 for not found.']}, {'end': 1377.494, 'segs': [{'end': 1092.611, 'src': 'embed', 'start': 1046.843, 'weight': 0, 'content': [{'end': 1050.004, 'text': 'So here we will create two methods, get method and a post method.', 'start': 1046.843, 'duration': 3.161}, {'end': 1054.905, 'text': 'So the very first method that is your get method, it is used to return all the employees in our model.', 'start': 1050.564, 'duration': 4.341}, {'end': 1059.727, 'text': 'And then the second method which is your post method, it helps you to create a new employee.', 'start': 1055.385, 'duration': 4.342}, {'end': 1061.987, 'text': 'So let me create these methods one by one.', 'start': 1060.167, 'duration': 1.82}, {'end': 1067.589, 'text': 'And the next method that is my post.', 'start': 1065.848, 'duration': 1.741}, {'end': 1075.691, 'text': "So now what I'll do, I'll go in my first method, I'll just remove this pass which basically means do nothing.", 'start': 1070.47, 'duration': 5.221}, {'end': 1078.081, 'text': 'And here I will pass in the request.', 'start': 1076.4, 'duration': 1.681}, {'end': 1083.285, 'text': "Now I'll create a variable which stores all my objects.", 'start': 1080.663, 'duration': 2.622}, {'end': 1087.067, 'text': 'So let me name it as employees, or you can say employees one.', 'start': 1083.765, 'duration': 3.302}, {'end': 1092.611, 'text': "I'll have my model and it'll say objects at all.", 'start': 1088.928, 'duration': 3.683}], 'summary': 'Creating get and post methods for employee model to retrieve all employees and add a new employee.', 'duration': 45.768, 'max_score': 1046.843, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI1046843.jpg'}, {'end': 1185.595, 'src': 'heatmap', 'start': 1148.145, 'weight': 5, 'content': [{'end': 1150.127, 'text': 'Now what we have to do, we have to connect or link it.', 'start': 1148.145, 'duration': 1.982}, {'end': 1152.588, 'text': 'So for that, we have to go to URLs file.', 'start': 1150.527, 'duration': 2.061}, {'end': 1157.532, 'text': "So here we will go to our main project, that is my project, and we'll go to urls.py file.", 'start': 1153.229, 'duration': 4.303}, {'end': 1162.735, 'text': 'So here you have to add some imports, which are compatible with APIs and REST Framework.', 'start': 1158.653, 'duration': 4.082}, {'end': 1166.398, 'text': "So I'll add here from REST Framework.", 'start': 1163.456, 'duration': 2.942}, {'end': 1175.15, 'text': "So this I'll be explaining later as we go on and have more functions to play with.", 'start': 1171.328, 'duration': 3.822}, {'end': 1180.292, 'text': "So in my code, you'll not be requiring this as such, but the other thing you require is to import your view.", 'start': 1175.61, 'duration': 4.682}, {'end': 1185.595, 'text': 'So for importing your view, you have to type in webapp import views.', 'start': 1180.892, 'duration': 4.703}], 'summary': 'Connecting and linking urls in my project, adding imports for apis and rest framework, and importing views for webapp.', 'duration': 46.035, 'max_score': 1148.145, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI1148145.jpg'}, {'end': 1244.768, 'src': 'heatmap', 'start': 1216.175, 'weight': 0.776, 'content': [{'end': 1221.542, 'text': 'So by hitting on employees it will connect to my view and in my view there is a class called as employee list.', 'start': 1216.175, 'duration': 5.367}, {'end': 1228.11, 'text': "So I'll go to my views and here I'll see I have my list that is employee list and it will return these things as a view.", 'start': 1221.802, 'duration': 6.308}, {'end': 1233.637, 'text': 'Therefore going on employees it will go to my views and then it will return the class that is employee list as view.', 'start': 1228.671, 'duration': 4.966}, {'end': 1237.745, 'text': "So in this way, we'll get the data in a JSON format.", 'start': 1234.704, 'duration': 3.041}, {'end': 1239.706, 'text': 'So with this, our code is completed.', 'start': 1238.165, 'duration': 1.541}, {'end': 1244.768, 'text': "Now what you have to do, you just have to throw this URL and connect to any website's database.", 'start': 1240.126, 'duration': 4.642}], 'summary': 'Code completed to return employee list as a view, yielding data in json format.', 'duration': 28.593, 'max_score': 1216.175, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI1216175.jpg'}, {'end': 1292.369, 'src': 'heatmap', 'start': 1258.552, 'weight': 3, 'content': [{'end': 1262.734, 'text': "Here I have to write employees, which is my URL that I've just created.", 'start': 1258.552, 'duration': 4.182}, {'end': 1266.734, 'text': 'Okay, so this is showing me an error that name true is not defined.', 'start': 1263.652, 'duration': 3.082}, {'end': 1273.058, 'text': 'So let me go back to my code and see in my views file, now this will work.', 'start': 1267.214, 'duration': 5.844}, {'end': 1276.7, 'text': "So I'll again go to my localhost and I'll refresh it.", 'start': 1273.478, 'duration': 3.222}, {'end': 1279.661, 'text': 'So yes, it displayed.', 'start': 1278.581, 'duration': 1.08}, {'end': 1282.943, 'text': 'So as you can see here, I have all my employee information.', 'start': 1280.082, 'duration': 2.861}, {'end': 1285.465, 'text': 'I have their IDs, their first name, and their last name.', 'start': 1283.083, 'duration': 2.382}, {'end': 1292.369, 'text': 'So this is the format of JSON, which are basically surrounded by curly braces having all your data and a descriptive title to it.', 'start': 1285.905, 'duration': 6.464}], 'summary': 'Created url to display employee information with ids, first names, and last names in json format.', 'duration': 33.817, 'max_score': 1258.552, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI1258552.jpg'}], 'start': 1026.904, 'title': 'Creating restful api in django', 'summary': 'Covers creating a restful api in django, including a class-based view for employee list, methods for getting all employees and creating new employees, and the process of serializing objects into json. it also includes linking views to urls, accessing data in json format, and making successful get requests, culminating in a fully functional api.', 'chapters': [{'end': 1138.299, 'start': 1026.904, 'title': 'Creating employee list api view', 'summary': 'Discusses creating a class-based view for an employee list, including methods for getting all employees and creating new employees, alongside the process of serializing the objects into json.', 'duration': 111.395, 'highlights': ["Creating a class-based view named 'employee list' that inherits from an API view", 'Defining methods for getting all employees and creating new employees', 'Serializing the objects into JSON to return multiple JSON objects as HTTP response']}, {'end': 1377.494, 'start': 1139.56, 'title': 'Creating restful api in django', 'summary': 'Covers the process of creating a restful api in django, linking views to urls, accessing data in json format, and making successful get requests, culminating in the creation of a fully functional api, with the ability to retrieve data from any device.', 'duration': 237.934, 'highlights': ['The chapter covers the process of creating a RESTful API in Django It explains the steps involved in creating a RESTful API in Django, including linking views to URLs, accessing data in JSON format, and making successful GET requests.', 'The ability to retrieve data from any device The API allows the retrieval of data from any device, such as iPhones, Android devices, or any other device connected to the internet, showcasing its universal accessibility.', 'Accessing data in JSON format The process involves accessing data in JSON format, with examples showing how the data is structured within curly braces and accessible using a specific URL.', 'Making successful GET requests The demonstration includes making successful GET requests, with the API displaying data in JSON format, indicating the successful implementation of the API.']}], 'duration': 350.59, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ejJ-2oz4AgI/pics/ejJ-2oz4AgI1026904.jpg', 'highlights': ["Creating a class-based view named 'employee list' that inherits from an API view", 'Defining methods for getting all employees and creating new employees', 'Serializing the objects into JSON to return multiple JSON objects as HTTP response', 'The chapter covers the process of creating a RESTful API in Django', 'Linking views to URLs, accessing data in JSON format, and making successful GET requests', 'The ability to retrieve data from any device, showcasing its universal accessibility', 'Accessing data in JSON format with examples showing how the data is structured within curly braces', 'Making successful GET requests, with the API displaying data in JSON format']}], 'highlights': ['The chapter covers the process of creating a RESTful API in Django', 'Creating a RESTful API allows universal data communication in a common format like JSON, reducing code duplication and size while serving various platforms (e.g., Android, iOS, etc.)', 'The serializer class is used to convert a model to JSON data, necessary for responding to user requests with JSON instead of HTML', 'The process of installing Django Rest Framework using Python package manager is explained, including using command line and PyCharm for installation', 'REST architecture is used for web APIs for data communication and supports common HTTP methods such as GET, PUT, POST, and DELETE, enabling interaction between machines or applications']}