
Explore building a Netflix-like service with Django by creating a playlist and video model, applying proxy models, generic foreign keys, and advanced testing, then add admin and rating.
Explore the DjangoFlix backend by examining models, proxy models, and Q lookups, and see how proxy models enable behavior without new tables.
Set up the Django flicks project and workspace by creating a virtual environment, installing Django 3.2, and configuring a requirements file.
Explore building a Netflix-like service with Django by modeling videos, playlists, seasons, categories, tags, and a one to five star rating system, plus search and future APIs.
Activate the virtual environment, install the required packages, and create the django project using django-admin startproject djangoflix, then run the server and verify migrations.
Design a videos app by modeling a Video with title, description, video_id, published state and timestamps, alongside a Playlist. Choose fields such as CharField, TextField, and SlugField, then run migrations.
Run your first Django migrations with manage.py, create a superuser for testing, and wire the video app and video model into the project for production readiness.
Add the videos app to the Django project, run makemigrations, migrate, and test, then adjust models by setting max_length and allowing blank or null description.
Learn to write Django model tests by setting up a test case, creating a video object, querying with a title, and asserting results against the isolated test database.
Breaking tests show how migrations manage schema changes, as you rename a field from title to name, run make migrations and migrate to update the database.
Expose the video model in the Django admin, use a proxy model for published videos, and customize verbose names to manage two video types through admin.
Customize the Django admin for videos by using video admin and video proxy admin, with list display, search fields, and an active flag to separate all versus published videos.
Customize the Django admin with advanced list filters, add published indicators, expose is_published as a display field, and use read-only fields and proxy models to streamline management.
Define video state choices in the django model, using a two-character char field with publish and draft values; then toggle state and auto-set a published timestamp via a save override.
Create and validate Django video state tests to confirm draft and published states. The lecture demonstrates filtering by state and publish timestamp using state options.
Create and manage slug, timestamp, and updated fields in a Django video model, run migrations, and validate slug behavior with tests to ensure reliable lookups.
Explore implementing a custom model manager and a custom query set to filter data, expose a published scope, and test these behaviors before migrations and signals.
Learn to replace save overrides with Django signals, using pre save receivers, publish state options, and slugify to create reusable, testable publishing logic across models.
Create a separate playlists app in django, establish a foreign key relationship to videos, migrate and test the integration, and expose the relation in admin for easy exploration.
Learn how to manage foreign keys in the Django admin by exposing a reverse relationship from videos to playlists, using a get_playlist_ids method to display related IDs.
Explore foreign keys by creating and inspecting Django model objects in the Python shell, using playlists and videos to demonstrate reverse relations, the playlist set, and query sets.
Explore implementing many-to-many relations in Django by using related_name for reverse relationships between playlists and videos, managing migrations, tests, and playlist item associations.
Explore foreign keys and many-to-many fields by modeling students and courses, including course grades and parent relationships, and learn to add, remove, set, and clear associations.
Explain the downsides of many-to-many fields and show how to replace them with a through model playlist item featuring foreign keys, timestamp, and order, plus migrations.
Learn to enhance the Django admin with a tabular inline for the playlist through model, enabling ordering and easy management of videos in a playlist.
Explore how to validate playlist through model integrity by comparing video IDs across related querysets, testing ordering, and ensuring playlist items align with video cues in a DjangoFlix workflow.
Create tv show and season playlist proxies in Django admin, customize proxy managers, and refine the get query set behavior to show accurate parent relationships.
Explore how to design a flexible video collection with a single playlist model, using a playlist type with choices for movie, TV show, season, and playlist to enable analytics.
Learn to implement a single Django model with proxies to automatically set playlist type via an overridden save method, plus admin configuration for movie and tv proxies.
Explore the categories app by creating a category model linked to playlists, with fields like title, slug, timestamp, and active status, contrasting categories with tags via the admin.
Learn to implement generic foreign keys using Django's content types framework, work with content type objects, app labels, and model classes, and test through the admin interface.
Explore how generic foreign keys lack reverse relationships and expose them with Django's content type framework. Use a related query name and admin inlines for tag items.
Learn how to test Django generic foreign keys with tagged items and a playlist model, covering content types, related fields, and multiple test patterns for robust validation.
Implement a django ratings app to compute average ratings for objects like playlists and categories using a five-star integer rating with an unknown option, linked to the user via settings.AUTH_USER_MODEL.
Explore robust Django tests for a ratings model by efficiently creating diverse users and playlists with bulk_create, validating rating counts and distributions using random rating choices.
Compute the average rating for a playlist using the generic relation to ratings and the Avg aggregation on the rating value. Verify results via shell and tests.
Set up the templates directory and base.html for Django templates, enabling inheritance with a block content; explore pathlib paths and Django's path handling for template dirs.
Learn to build movie and TV show list views in Django using class-based list views, proxies, and customized templates with context data.
Update the playlist template to conditionally display the title, render an item list, and enhance seo with a head title, while showing seasons via a get_short_display.
explores testing proxy models in Django by converting playlist tests to movie and tv show proxies, validating slug fields, published counts, and proxy managers.
This is not a Netflix clone and not even close. Why? Netflix is a complex system of engineer that no one class could ever fully cover. If I told you that you could build a Netflix clone in less than 40 hours, I would be lying to you.
Instead, this is a foundation of what a Netflix-like service could be. This foundation only matters as it serves a roadmap to understanding Django on a whole new level.
Django is the most popular web framework in the world written in Python and for good reason: Django is incredibly simple and incredibly complex.
Models, Views, Forms, User Auth and Templates are fundament to Django. After completing one of my Try Django series, you'll see that creating rich web applications is, well, pretty simple. Models map to database tables. Views essentially handle a url and render templates. Forms help validate data and templates are essentially HTML with a little programming built it.
If the paragraph above is unclear, this course is not for you.
Django's complexity comes with the layers of abstraction you can start to build within your projects. To me, these layers come from Generic Foreign Keys & Proxy Models. The complexity on the surface might be intimating (it was for me) but after you get familiar with them you'll come to find their complexity to be less daunting and potentially, no longer complex.
The goal of this course is to introduce your to a number of concepts you may have never seen before while building the foundation for a service that could potentially grow into Netflix.
Here's some topics we'll cover:
Proxy Models
Generic Foreign Keys
Generic Relations
Automated Unit Testing
ManyToMany Fields vs Foreign Keys vs Generic Foreign Keys
Through models for ManyToMany
Reverse Relationships
Creating a Rating System (user ratings)
Complex Search Lookups with Q Lookups
Re-usuable model receiver functions
Custom template tag for rending a rating form
and much more