Ready to Start Learning?

Sign in to check if you already have access, or get started with a purchase or membership.

Django x Next.js

Integrate a Django REST API with a Next.js Frontend

0:00
7/1/2024
Integrate Django with Next.js!
Django is awesome. Next.js is awesome. The two together give you the best of both worlds.
Topics covered:
  • Python and Django web development
  • Django Ninja for our Rest API URLs & Schema
  • JWT Authentication for Django & Next.js
  • User interface with shadcn ui and tailwindcss
  • Production database with Neon Postgres
  • Deployment for both Django and Next.js to Railway
Django is a powerful web framework that handles user auth, database management (ORM), form validation, has a built-in admin, and, of course, is written in Python.
Django Ninja is a fast way to build a Rest API for Django. It's inspired by FastAPI but gives you all of the Django-ness you want.
Next.js is React.js with url routing built-in along with server-side features that make it well suited as a full web framework.
React.js is one of the best ways to make modern and powerful frontends.
shadcn ui is a popular React package that makes it easy to copy and paste UI components that are highly customizable and use tailwindcss.
Thank to Neon for helping bring this course to life at no-cost to you.
Django x Next.js

Lifetime access to this course

or get access to 500+ courses with a membership

Sections

1

Welcome

0:00

2

Overview & Requirements

0:00

3

Demo

0:00

4

Project Setup

0:00

5

Hello World with Django Ninja

0:00

6

User Auth with Django Ninja JWT

0:00

7

Custom Django Model with Matching Ninja Schema

0:00

8

Get and List Models via Django Ninja Router

0:00

9

Your First API request from Next to Django

0:00

10

Solve CORS Errors from Next to Django

0:00

11

Get API Data on Page Load with SWR

0:00

12

Submit Form Data with NextJS

0:00

13

httpOnly Cookies with Nextjs API Routes

0:00

14

Data from Nextjs Server to Django Backend

0:00

15

Auth Token Methods

0:00

16

Logout Page and API Route in Nextjs

0:00

17

User Required Requests from Nextjs to Django

0:00

18

Custom Context Provider and useAuth Hook

0:00

19

Login Required Redirect for Invalid Auth Tokens

0:00

20

Install shadcn to Nextjs

0:00

21

Login Page with shadcn ui

0:00

22

Base Layout with Navbar

0:00

23

Navbar Component

0:00

24

User and Non User Navbar Links

0:00

25

Waitlist Form and NextJS API Endpoint

0:00

26

Django Ninja Create Object via POST

0:00

27

Django Ninja User or Annon User Required

0:00

28

Django User Foreign Keys

0:00

29

Decouple Navbar Components

0:00

30

NextJS API Proxy Class

0:00

31

NextJS List view as shadcn Table

0:00

32

Improve API Proxy Class

0:00

33

Django Form Validation with Django Ninja

0:00

34

Rendering Django Form Validation Errors in Nextjs

0:00

35

Nextjs Config for Environments

0:00

36

Environment Variables in Django

0:00

37

Deploy Django Project to Railway

0:00

38

Production Django Database with Neon Postgres

0:00

39

Prepare our Nextjs Production Build

0:00

40

Nextjs Production Frontend on Railway

0:00

41

Dynamic Routing in Nextjs Pages and Routes

0:00

42

Adding and Updating New Database Fields

0:00

43

Deployed

0:00

44

Thank you and thoughts on how practical this is

0:00

Django x Next.js - Coding for Entrepreneurs