Creating a Web Chat Service with Python/Django (Feat. Channels) - Basics
The Channels library is a real-time messaging library developed under the philosophy of Django.
Quickly learn the essence of Channels through this lecture.
Distributed messaging and websocket processing using Django Channels
Understanding WebSocket Communication
Real-time web chat service
Life is short. Even in real-time web service development, with Django/Channels, Run your business successfully and save time. 💪
Take the course and get a PyCharm Professional coupon! 🎫
We've received a 6-month coupon from JetBrains for PyCharm Professional (paid tool), the optimal IDE for Django development, so you can continue using it after the course. After completing the course, please apply using the method below.
During the lecture, you will use a 1-month trial license for PyCharm Professional.
Even if you are not a regular student, if you have registered for the course, you can apply for a coupon through the Google form below.
We will check your application details by Friday every week and send you a coupon to the email address you provided.
Please register any coupons you receive immediately. Failure to do so will result in you no longer receiving license support from JetBrains.
Coupon applications can only be made once per person per class .
Tip: After using this coupon, you can continue to subscribe to JetBrains at a discounted price using the same account.
Note: Students and teachers can receive a one-year license for all JetBrains tools through the JetBrains Student Support Program . Once you apply for the program, you'll receive your license within a few days.
Lecture Topics 📖
Channels is a library that is consistently mentioned as a core Django library, even overseas. Released as version 1.0 in 2017, it is a mature library, reaching version 4.0 in November 2022.
Knowing Channels allows you to add real-time functionality to web services with a minimal amount of code. However, it's unfortunate that so many people are unaware of Channels and lack access to resources, making this difficult. Therefore, I've diligently developed this course to help many people learn real-time web development more easily.
The Channels library inherits the philosophy of the highly productive Django framework. It helps reduce repetition and focus on the core. Let's properly understand the Channels library and learn how to build a highly productive real-time websocket chat service based on Channels.
By taking this course, you will gain a deep understanding of Channels and be able to quickly build real-time web services with Django's high productivity .
📢 Please note before taking the class.
Korean subtitles are available for the latter 60% of the uploaded lecture videos, and Korean subtitles for the first 40% are currently being worked on. The remaining subtitles are scheduled to be completed by December 2022.
As of Friday, December 23, 2022, all subtitle work has been completed.
I recommend this to these people 🙋
After learning the basics of Django Those looking for a new challenge
On a static web page For those who want to feel energized
Real-time chat service Anyone who wants to make it
Learn channels For those who want to understand deeply
Lecture Features ✨
A true Djangoholic developer A lecture that only extracts the core of the channel
Step by step from the basics Stacking WebSocket Communication
Lecture slides PDF provided
All lectures with Korean subtitles Quickly grasp the lecture content!
Rich WebSocket examples : Echo messages, live blogs, and web chat
By implementing Echo WebSocket with Channels, we open the prelude to learning about the Channels chat service.
3. (Practice) Sending and Receiving JS Objects via WebSocket
All communication requires serialization and deserialization. We'll examine common mistakes made during serialization in JS and explore JSON serialization and deserialization methods in WebSocket clients and channels.
4. Running and connecting to the Redis server
We'll explore how to integrate Redis Enterprise Cloud's Free Plan into a Django project, exploring how to register Redis account information as environment variables and efficiently retrieve and process it in Django. Finally, we'll review the command to run a Redis server with Docker.
5. Interprocess communication using the channel layer
Channels supports inter-process communication through the Channel Layer. Let's examine the types of backends supported by the Channel Layer and summarize its core APIs.
6. (Practice) Web Socket Liveblog
Let's create a live blog service that responds in real time to server-side blog post additions, edits, and deletions without refreshing the webpage. You'll experience the simple yet powerful power of Django Channels.
7. Data types that can be transmitted to the channel layer
Serialization and deserialization are essential in all communication. We'll examine the serialization methods used in communication with the channel layer and delve into the serialization constraints imposed by the channel layer.
8. WebSocket Reconnection
Networks can be disconnected at any time. Even WebSockets, which require persistent connections, can experience disconnections at any time. Let's look at two ways to handle WebSocket reconnections.
9. Inheritance relationship of Consumer class
In Channels, the subject of request processing is the Consumer. Let's examine the inheritance relationship of the Consumer class provided by Channels and examine each role in detail.
10. Creating a Real-World Chat Service
As a core part of this course, we will create a chat service using Django Channels effectively.
11. Security
Channels supports two middlewares to defend against WebSocket CSRF attacks, a security feature. Let's look at an example of a CSRF attack and learn more about how to configure the two middlewares.
Expected Questions Q&A💬
Q. Are there any environment requirements or other precautions I need to take before taking the course?
To install and run Redis, you'll need a computer with Docker installed. If you can't install Docker, don't worry. We'll show you how to use the managed Redis service in Redis Enterprise Cloud on redis.com with the Free Plan.
Q. What can I do after learning the contents of this lecture?
With Django, you can develop real-time web services with high productivity.
Introducing the Knowledge Sharer ✒️
I am Jinseok Lee , a software developer who is passionate about Python and Django.
Python addict, Django developer with 16 years of practical experience
Seoul National University, Joint Major in Venture Management, Python/Django lecturer, "Venture Startup Web Programming" (2016/2017)
Fast Campus, Web Service Development Camp (Python/Django) 3rd Instructor (2015)
Lectures and consulting at numerous universities and companies: Seoul National University, KAIST, Pusan National University, Hanyang University, Kookmin University, Samsung Electronics, LG Electronics, LS Group, SK Planet, Encore, KB Securities, SK Telink, Hyundai Motor Group Innocean, Koscom, Naver NIT Service, Art Center Nabi, Bank of Korea, Korea Institute of Industrial Technology Evaluation and Planning, etc.
Recommended for these people
Who is this course right for?
Those who have learned the basics of Django and are looking for a new challenge
Anyone who wants to quickly learn real-time web service development
Need to know before starting?
Python Language Fundamentals (Functions, Classes, Decorators)
Django Basics (Understanding Views, Models, and Templates)
There is only an explanation of function development, but it lacks an explanation of the principles used in developing the function. It would be a good lecture if you want to create a chat room, but it seems difficult to understand channels.
I've looked for videos and lectures related to Django Channels, but I haven't found any lectures as helpful as this one.
The content covers a lot and moves quickly, so you can't let your mind wander even for a moment, making it hard to watch in a relaxed state. However, it's been extremely helpful because it teaches the necessary feature implementations for WebSocket authentication and building actual chat services.
While these might be issues you could resolve through direct implementation using searches or ChatGPT, there's a lot of content that's good to know in advance.
It's a very interesting lecture to listen to after completing the Django basic lecture.
This lecture is older, so there are differences in versions, but it's also fun to fix errors one by one for the latest version.
It's fun!