Sam Bolgert, 'REST Websockets API with Django Channels', PyBay2016

preview_player
Показать описание
Building REST APIs over HTTP has been discussed time and again. But could we do the same with WebSockets? What is the performance benefit? What learnings can we carry over from HTTP to WS? This talk will describe how engineers can build a REST API over WebSockets using Django and Channels. It is largely based on my experiences trying to build a REST WebSocket API.

Abstract
Websockets have been around for a number of years but popular web frameworks have been slow to integrate because of their asynchronous nature. With Django Channels we’ve finally broken that frontier in a synchronous way. How will developers use this new territory? I will outline some of my explorations that I have serialized into a library I call channels-api. It takes familiar patterns from Django Rest Framework and applies them to websocket land. I will walk through a sample project to demonstrate the configuration and installation of the library. I will demonstrate using these patterns we can create a “REST like” API relatively quickly. We can also implement new features that HTTP doesn’t support like server side push.

Bio
Author of channels-api library. Former Lead engineer at a number of startups.

Рекомендации по теме
Комментарии
Автор

I did everything the same, and it seems to work for me, but I do not understand how the client will listen to the server. The client must listen to the server on the port, and in certain events the server must notify the client. How can a client listen to the port by socket?

ramazanraice
Автор

Who else plans on using this to develop a distributed system??
Please, any idea about the stability of the Bindings class now??

NphiniT
Автор

Question: Is this good for updates and to subscribe to changes kind of line angulars subscribe were users are being sent noifications of changes ? thanks

Zzzzzzzzzzzzzzzzzzzzr
Автор

Thank you for a great talk. Please share the source code of this demo.

sohamnavadiya