Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Overview of Models | What is Serialization?
Django REST Framework
course content

Course Content

Django REST Framework

Django REST Framework

1. What is the Rest API ?
2. What is Serialization?
3. Views and Routers
4. HTTP Request Methods

book
Overview of Models

Where do the data displayed on a website or mobile app come from?

For instance, if you're creating a blog, you need to store information about articles, comments, and users. Models in Django REST Framework (DRF) define the structure of this data. They serve as a way to organize and store data in your application. When you define models, DRF can use them to create an API that allows your clients (such as web pages or mobile apps) to access this data over the internet. Thus, models are the foundation of your application, enabling it to work with stored data and provide them through an API.

The Application Model We Will Develop Throughout the Course

Model will store information about a product, such as its name, description, price, available quantity, and the path to an image (here will be stored either a link to an image or the local path to it).

As we can see in the illustrations, all this information will be needed on the frontend. Therefore, on the backend, we need to store it for later send it to the frontend.

Primary Key - (pk) field

In Django, the pk field stands for "primary key." It's a special field that every record in a database table gets automatically. Its purpose is to give each record a unique identifier. For instance, if you have a table of products, each product will have its own pk. Django handles this field automatically unless you specify another field for this purpose.

What role do models play in a Django REST Framework (DRF) application?

What role do models play in a Django REST Framework (DRF) application?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 2
We're sorry to hear that something went wrong. What happened?
some-alt