Web Development On-Demand

Building REST APIs with Django Ninja On-Demand (DJG650)

Learn to design and build REST APIs with Django Ninja, Pydantic, databases, CRUD endpoints, query parameters, Fetch, and practical API error handling.

Enroll in On-Demand Training

Price per student
$49.00
  • On-demand access, 24/7
  • Readings, videos, and exercises
  • Quizzes to check your knowledge
  • Lifetime access

Course Overview

Building REST APIs with Django Ninja is a practical course for developers who want to move from consuming APIs to designing and building their own. You’ll review core REST concepts, learn how to represent and name resources, work with JSON and HTTP status codes, and design clear API endpoints before implementing them with Django Ninja.

Through hands-on exercises, you’ll build a Django Ninja API using Pydantic schemas and a database, then create the core CRUD operations needed to create, read, update, and delete data. You’ll also connect your API to a fetch-powered frontend, work with query parameters, post and retrieve data, and add error handling for more reliable client-server interactions.

Course Benefits

  • Design REST API endpoints around clearly defined resources and appropriate HTTP conventions.
  • Represent API data with JSON and use HTTP status codes to communicate request outcomes.
  • Set up Django Ninja and create API endpoints through hands-on exercises.
  • Use Pydantic schemas to define and validate data exchanged through an API.
  • Configure database-backed API functionality for storing and retrieving application data.
  • Build CRUD endpoints for creating, reading, updating, and deleting resources.
  • Use query parameters to support more flexible API requests.
  • Connect a frontend to Django Ninja endpoints using the Fetch API.
  • Apply error handling techniques to return useful responses when API requests fail.
  • Practice building a complete workflow that connects REST API design, Django Ninja, database operations, and frontend requests.

Course Outline

  1. Designing REST APIs
    1. Review of REST APIs
    2. From Consumer to Builder
    3. Representing Resources with JSON
    4. Identifying and Naming Resources
    5. Using Status Codes to Determine Outcome
    6. Designing Your API Endpoints
  2. Building Your First Django Ninja API
    1. Why Django Ninja?
    2. Installing Django Ninja
    3. Your First Endpoint
    4. Pydantic Schemas
    5. Setting Up the Database
    6. Writing to the Database
    7. Reading from the Database
  3. CRUD and a Fetch-Powered Frontend with Django Ninja
    1. Setting Up the Frontend
    2. Posting Data
    3. Query Parameters
    4. Fetching Data
    5. PUT and DELETE Endpoints
    6. Error Handling in Django Ninja

Course Prerequisites

Required experience

  • Basic proficiency with Python and Django.
  • Familiarity with HTML, JavaScript, and JSON.
  • Basic knowledge of relational databases and SQL.

Useful experience

  • Experience consuming REST APIs with tools or applications.

Prerequisite Courses

Have questions about this course?

We can help with curriculum details, delivery options, pricing, or anything else. Reach out and we’ll point you in the right direction.