How to Build Simple Realtime Chat Application using Django 4 Part 1: Creating Django Project

Photo by Pradamas Gifarry on Unsplash

In This Post, I will discuss how to build a simple real chat application using Django and ASGI Channel, here is the case

The Case

If you’re looking at adding real-time capabilities to a Django project with WebSocket, you have two main options.

Using Django Channels, a project adding WebSocket to Django, among other features. This approach is fully supported by Django. However, it requires switching to a new deployment architecture.

Deploy a separate WebSocket server next to your Django project. This technique is well suited when you need to add a small set of real-time features — maybe a notification service — to an HTTP application.

so we can build a real-time app using ASGI service and WebSocket then integrate to Django, to integrate with Django, we need to install some package called Channel

Creating A Django Project

to create a Django project we need to set up virtualenv

pip install virtualenv

to create using this command

virtualenv venv

Activate on Windows


Activate on Linux or Mac

source venv/bin/activate

Installing Required Package using pip

The next step is to install a required package using pip

pip install django channels

then create a project with Django admin

django-admin startproject core

and rename the core directory to backend

Interesting with Blockchain and Opensource Project my journal:

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

What an Engineer Does

DeepCode adds AI-based static code analysis support for C and C++

Script Communication using GetComponent for Unity

Intro to Databases on Linux

Go: Discovery of the Trace Package

Creating a “hello, world” Open Liberty project in Eclipse Codewind: a user journey

Recurring Revenue Tracking

Laravel Advance | Laravel Middleware Tutorial With Example

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Feri Lukmansyah

Feri Lukmansyah

Interesting with Blockchain and Opensource Project my journal:

More from Medium

Let’s build a video sharing app with Django

How to filter query with dynamic multiple query params in django rest framework

User Authentication — User Auth with REST API in Django Part 3

Solve N+1 Selects Problem with prefetch_related Method in Python’s Django(DEMO)