Django ws
Upcoming SlideShare
Loading in...5
×
 

Django ws

on

  • 1,590 views

Presentation about Websocket usage within Python projects, using txWebsocket, Twisted and Django.

Presentation about Websocket usage within Python projects, using txWebsocket, Twisted and Django.

Statistics

Views

Total Views
1,590
Views on SlideShare
1,196
Embed Views
394

Actions

Likes
0
Downloads
4
Comments
0

2 Embeds 394

http://www.goldmund-wyldebeast-wunderliebe.com 389
http://localhost 5

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Django ws Django ws Presentation Transcript

  • Django WSBuilding Single-page web-applications with Django, Twisted and TxWebsocket Jeroen van Veen
  • Websockets?● Persistent TCP connection browser-server● Data exchange ○ Handshake protocol (currently Hybi-16) ○ Both UTF-8-encoded & binary data ○ Low latency, no headers ○ Easy serializing with JSON● Support ○ Python: TxWebsocket, Autobahn WS, Gevent-websocket ○ Browser: Chrome, Firefox, Opera, Safari, IE10 ○ Browser fallback: Flash Websocket
  • Multi-page VSSingle-page
  • Bootstrapping● Each url routes initially to the HTML/JS bootstrap view● The websocket connection is initialized● During the handshake, the sessionid cookie is being reused● Set transport.user and add the transport to the client Pool● Signals are used to notify listening code for events like connect, disconnect, view_changed, etc.● The navigation-bar URL is routed through the javascript application and gets the appropriate content
  • URL Routing● Mimick Django URL routing serverside● And clientside...● XRegexp for named group support● Usable with HTML5 history API● Capture link click events● Client URL tracking and signalling
  • Django-WS● Django authentication during handshake with session cookie● Client transport pool handling● Event subscription (f.i. client connect,disconnect)● Websocket URL-routing protocol● Twisted MultiFile for static resources & management commands to integrate Twisted in Django● dws namespace, seperate python modules● Clientside RequireJS modules● BSD license
  • In development● Django-ws modules: core, misc, blog, wiki● Narrowcaster● ...
  • Challenges● Integrate further with Django ○ Use existing conventions where possible ○ Compatibility modus for HTTP-based Django apps● Cleanup design● Proper documentation● Usable reference Websocket CMS● Community● SEO
  • Questions? Code https://github.com/phrearch/django-ws-core Contact vanveen@gw20e.com https://twitter.com/#!/jeroen_van_veen