Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Overview of Api Router | Views and Routers
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

bookOverview of Api Router

arrowfolder
__init__.py

__init__.py

folder/
folder

main

folder

migrations

__init__.py

__init__.py

admin.py

admin.py

apps.py

apps.py

models.py

models.py

serializers.py

serializers.py

tests.py

tests.py

urls.py

urls.py

views.py

views.py

manage.py

manage.py

requirements.txt

requirements.txt

folder

shop

__init__.py

__init__.py

asgi.py

asgi.py

settings.py

settings.py

urls.py

urls.py

wsgi.py

wsgi.py

copy

Api Router is a built-in tool in DRF that generates an API interface in the web browser. This allows you to easily test and debug your DRF API endpoints without the need to write JavaScript code.

How to use Api Router ?

  1. Start the Django server with your DRF project;
  2. Navigate to the URL http://127.0.0.1:8000/ in your web browser;
  3. You will see a list of all API endpoints defined in your DRF project;
  4. You can click on an API endpoint to view its details, including the URL, HTTP methods, and expected request and response data;
  5. You can use Api Router to send requests to your DRF API endpoints and view the response.

Advantages of using Api Router

  1. Api Router does not require knowledge of JavaScript to test DRF APIs;
  2. Api Router generates a clear and understandable interface for your API endpoints;
  3. You can use Api Router to send requests to your DRF API endpoints and view responses in real-time;
  4. Api Router can help you debug issues with your DRF API endpoints.
What is the purpose of the API Router in Django Rest Framework?

What is the purpose of the API Router in Django Rest Framework?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 5
some-alt