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

venv\Scripts\activate

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: https://www.perykun.xyz/

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

Recommended from Medium

BeeWoo Hexapus NFT Trading Cards

Ask for help effectively (fast problem solving)

Running and debugging Go Lambda functions locally

What is a full-stack developer?

Between Two Sets (sol-)

Beginning of FPGA Era in Data Centers

The Perfect Layout? Pro you say?

Create Anki Deck from scratch

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: https://www.perykun.xyz/

More from Medium

Introduction to Django Framework

introduction to Django Framework

A Django Blog In VS Code — Authentications, Login & Logout

How to create desktop notifications in Django?

Building a simple Poll System in Django [Part - I]