Using Multiple Database Tables With Django - Django Wednesdays #4

Codemy.com February 10, 2021
Video Thumbnail
John Elder Logo

John Elder

@johnelderai

About

AI is taking over the world...let's get into it! OpenClaw, Claude Code, Manus, Perplexity, and whatever other weird AI stuff that comes along with a pinch of Python Programming thrown in from time to time. Check out my website JohnElder.AI and Codemy.com for more videos!

Video Description

In this video we'll start to set up our Database using many Tables. Using databases with Django is super easy. In this video we'll set up our database with three different tables; a Venue table, a Users table, and an Events table. I'll show you how to connect the tables using Foreign Keys and ManyToMany Fields. We'll also set up the Django Admin area, and add our three new database tables to the admin area. Timecodes 0:00​ - Intro 1:40 - Set Up Django Admin Section 2:44 - Create Django Admin User 4:43 - Intro To Django Databases 5:47 - Create Event Database Table 11:10 - Adding String Representation Method 11:56 - Create Venue Database Table 14:50 - Connect Event Table To Venue Table With Foreign Key 16:30 - Create MyClubUser Database Table 18:00 - Associate UMyClubUsers to Events With Many To Many Field 18:48 - Add Database Tables To Django Admin Area 21:14 - Start To Make Migrations 21:42 - On_delete=models.CASCADE 22:50 - Make Migrations and Migrate Database Tables 23:45 - Check Admin Area For Tables 27:44 - Conclusion