Sexy typing chat

I hope you're as excited as I am about the upcoming stable release of Django Channels.Until then, play as much as you like with them using our Blueprint below.Lately we see a constant switch towards real-time applications.With the wide support for Web Sockets in recent browsers, more and more frameworks are giving us the ability to use them.Let's start by creating our first consumer, which will be used to echo back messages sent through Web Sockets. You should be presented with the default Django screen, but you'll have a nice surprise if you try to use Web Sockets.Open your browser's console and type in the following Java Script code: // Create a new Web Socket ws = new Web Socket((window.location.protocol == 'http') ?I'll leave this for another post though and I'll stick to our main theme: leveraging the power of Web Sockets to create a real-time application using Django Channels.

Honestly, This game needs voice chat more than ever for competitive play .Though chats need to have at least a name behind each message.For this reason, we'll add a basic - and when I say basic, I really mean it - authentication.All you have to do is install some libraries and they will make all the hard work for you. This will give the following goodies out of the box: As a first example, let's create a simple Web Socket endpoint that will reply the same message we send to it.We will need a new Django app - which we'll name "chat" so that we can use it later on.

Leave a Reply