SlideShare a Scribd company logo
1 of 24
Download to read offline
Realtime Apps with Django
Renyi Khor
renyi.ace@gmail.com
– Renyi Khor
“Entrepreneur and CTO since 2012.
Djangonaut since 2009.
Progammer since 2006.
Programming since 1990s.”
Django
1.It’s a web framework.
2.It’s a heavy web framework (Batteries included).
3.It’s Secure - See No. 2.
4.It’s Python.
5.Large community.
6.It’s really good for prototyping and R&D.
Popular Django sites
• Disqus
• Bitbucket
• Instagram
• Pinterest
• Mozilla
• Nasa
• sentry.io, etc…
Django Channels
Django Channels
• ASGI - Asynchronous Server Gateway Interface
• Consumer-Producer Pattern
• Channels
• Worker and Background Tasks
Pros
• Easy to integrate with Django
• Django-ish routing
• Django ORM
• Customizable channel layers
• Make Django async
Cons
• Probably only heavy tested with Python and Django
users
• ASGI is quite new
• Too much work just to get websocket working
• Channels looks powerful, but complicated
Renyi’s Take
• Too complicated for prototyping
• May be good for R&D
• Yes or No ?
Tornado
Tornado
• Tornado is a Python web framework and asynchronous
networking library, originally developed at FriendFeed.
Pros
• Built with non-blocking IO in mind.
• Many async options, long polling, websockets,
coroutines, queues, multi-process, etc.
• Lots of batteries, non-blocking HTTP server, async http
client, ioloops, iostreams, net utilities, etc.
• Play well with others, wsgi (django), twisted, asyncio
(python3.5+).
• Facebook is among the core developers.
Cons
• It’s more complicated to setup
• It’s harder to design applications around it
• Batteries are pretty low level (could be a PRO)
• Almost nothing is out-of-the-box (may not be a bad
thing)
Renyi’s Take
• Easy integration with Django (FallbackHandler)
• Makes Django async (make it green)
• Easy Django + websocket (IOLoop)
• A good scalling option for Django projects
• Yes or No ?
asyncio
asyncio
• https://docs.python.org/3/library/asyncio.html
Pros
• Standard Library
Cons
• You really shouldn’t be bothered with this.
• If you do, it’s most likely out of the scope of this
talk, :p
Renyi’s Take
What you need to know
• Yes. If you have a choice, choose asyncio.
• It works well with most web/networking framework.
• If not, most popular python frameworks are going to
implement it soon.
• So, choose a good web framework that uses asyncio.
• If you are working on IO stuffs, yes asyncio is really good for
your sanity.
• Yes or No ?
Django + Tornado +
Websocket + AsyncIO
Questions ?

More Related Content

What's hot

Debugging Spark: Scala and Python - Super Happy Fun Times @ Data Day Texas 2018
Debugging Spark:  Scala and Python - Super Happy Fun Times @ Data Day Texas 2018Debugging Spark:  Scala and Python - Super Happy Fun Times @ Data Day Texas 2018
Debugging Spark: Scala and Python - Super Happy Fun Times @ Data Day Texas 2018
Holden Karau
 
Big data beyond the JVM - DDTX 2018
Big data beyond the JVM -  DDTX 2018Big data beyond the JVM -  DDTX 2018
Big data beyond the JVM - DDTX 2018
Holden Karau
 

What's hot (20)

Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love it
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love itDrupal 8: Huge wins, a Bigger Community, and why you (and I) will Love it
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love it
 
Paragraphs at drupal 8.
Paragraphs at drupal 8.Paragraphs at drupal 8.
Paragraphs at drupal 8.
 
Day 8 - jRuby
Day 8 - jRubyDay 8 - jRuby
Day 8 - jRuby
 
Java to Golang: An intro by Ryan Dawson Seldon.io
Java to Golang: An intro by Ryan Dawson Seldon.ioJava to Golang: An intro by Ryan Dawson Seldon.io
Java to Golang: An intro by Ryan Dawson Seldon.io
 
Becoming A Php Ninja
Becoming A Php NinjaBecoming A Php Ninja
Becoming A Php Ninja
 
Debugging Spark: Scala and Python - Super Happy Fun Times @ Data Day Texas 2018
Debugging Spark:  Scala and Python - Super Happy Fun Times @ Data Day Texas 2018Debugging Spark:  Scala and Python - Super Happy Fun Times @ Data Day Texas 2018
Debugging Spark: Scala and Python - Super Happy Fun Times @ Data Day Texas 2018
 
PyCon Korea 2019 REST API Document Generation
PyCon Korea 2019 REST API Document GenerationPyCon Korea 2019 REST API Document Generation
PyCon Korea 2019 REST API Document Generation
 
Big data beyond the JVM - DDTX 2018
Big data beyond the JVM -  DDTX 2018Big data beyond the JVM -  DDTX 2018
Big data beyond the JVM - DDTX 2018
 
Why Your Site is Slow: Performance Answers for Your Clients
Why Your Site is Slow: Performance Answers for Your ClientsWhy Your Site is Slow: Performance Answers for Your Clients
Why Your Site is Slow: Performance Answers for Your Clients
 
Deploy Flex with Apache Ant
Deploy Flex with Apache AntDeploy Flex with Apache Ant
Deploy Flex with Apache Ant
 
Git Makes Me Angry Inside
Git Makes Me Angry InsideGit Makes Me Angry Inside
Git Makes Me Angry Inside
 
Migrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to GoMigrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to Go
 
Python x Django
Python x DjangoPython x Django
Python x Django
 
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 GolangCOSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
 
5 loaded guns Go hapily aims at your feet
5 loaded guns Go hapily aims at your feet5 loaded guns Go hapily aims at your feet
5 loaded guns Go hapily aims at your feet
 
Building Pluggable Web Applications using Django
Building Pluggable Web Applications using DjangoBuilding Pluggable Web Applications using Django
Building Pluggable Web Applications using Django
 
Modular Open Source in Java for Now and Later
Modular Open Source in Java for Now and LaterModular Open Source in Java for Now and Later
Modular Open Source in Java for Now and Later
 
50 Ways To Love Your Project
50 Ways To Love Your Project50 Ways To Love Your Project
50 Ways To Love Your Project
 
Functional Web Apps with WebMachine Framework - Mikhail Bortnyk
Functional Web Apps with WebMachine Framework - Mikhail BortnykFunctional Web Apps with WebMachine Framework - Mikhail Bortnyk
Functional Web Apps with WebMachine Framework - Mikhail Bortnyk
 
Untangling spring week11
Untangling spring week11Untangling spring week11
Untangling spring week11
 

Similar to Realtime Apps with Django

Django: Beyond Basics
Django: Beyond BasicsDjango: Beyond Basics
Django: Beyond Basics
arunvr
 
Introduction to Django (GDays 2014)
Introduction to Django (GDays 2014) Introduction to Django (GDays 2014)
Introduction to Django (GDays 2014)
Edem Kumodzi
 

Similar to Realtime Apps with Django (20)

Django Tutorial_ Let’s take a deep dive into Django’s web framework.pdf
Django Tutorial_ Let’s take a deep dive into Django’s web framework.pdfDjango Tutorial_ Let’s take a deep dive into Django’s web framework.pdf
Django Tutorial_ Let’s take a deep dive into Django’s web framework.pdf
 
C4ainaction-Introduction to the Pyramid Web Framework
C4ainaction-Introduction to the Pyramid Web FrameworkC4ainaction-Introduction to the Pyramid Web Framework
C4ainaction-Introduction to the Pyramid Web Framework
 
Django Intro
Django IntroDjango Intro
Django Intro
 
Django: Beyond Basics
Django: Beyond BasicsDjango: Beyond Basics
Django: Beyond Basics
 
Introduction to Django (GDays 2014)
Introduction to Django (GDays 2014) Introduction to Django (GDays 2014)
Introduction to Django (GDays 2014)
 
Python for web development
Python for web developmentPython for web development
Python for web development
 
python full stack course in hyderabad...
python full stack course in hyderabad...python full stack course in hyderabad...
python full stack course in hyderabad...
 
python full stack course in hyderabad...
python full stack course in hyderabad...python full stack course in hyderabad...
python full stack course in hyderabad...
 
The State of WebSockets in Django
The State of WebSockets in DjangoThe State of WebSockets in Django
The State of WebSockets in Django
 
divyanshBajaj.pptx
divyanshBajaj.pptxdivyanshBajaj.pptx
divyanshBajaj.pptx
 
Iceberg
IcebergIceberg
Iceberg
 
Go for Rubyists. August 2018. RUG-B Meetup
Go for Rubyists. August 2018. RUG-B MeetupGo for Rubyists. August 2018. RUG-B Meetup
Go for Rubyists. August 2018. RUG-B Meetup
 
State of angular ecosystem
State of angular ecosystemState of angular ecosystem
State of angular ecosystem
 
Using React for the Mobile Web
Using React for the Mobile WebUsing React for the Mobile Web
Using React for the Mobile Web
 
Mixing Plone and Django for explosive results
Mixing Plone and Django for explosive resultsMixing Plone and Django for explosive results
Mixing Plone and Django for explosive results
 
Go After 4 Years in Production - QCon 2015
Go After 4 Years in Production - QCon 2015Go After 4 Years in Production - QCon 2015
Go After 4 Years in Production - QCon 2015
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
 
Prototyping like it is 2022
Prototyping like it is 2022 Prototyping like it is 2022
Prototyping like it is 2022
 
Realtime web2012
Realtime web2012Realtime web2012
Realtime web2012
 
Django
DjangoDjango
Django
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Realtime Apps with Django

  • 1. Realtime Apps with Django Renyi Khor renyi.ace@gmail.com
  • 2. – Renyi Khor “Entrepreneur and CTO since 2012. Djangonaut since 2009. Progammer since 2006. Programming since 1990s.”
  • 3. Django 1.It’s a web framework. 2.It’s a heavy web framework (Batteries included). 3.It’s Secure - See No. 2. 4.It’s Python. 5.Large community. 6.It’s really good for prototyping and R&D.
  • 4. Popular Django sites • Disqus • Bitbucket • Instagram • Pinterest • Mozilla • Nasa • sentry.io, etc…
  • 6.
  • 7.
  • 8. Django Channels • ASGI - Asynchronous Server Gateway Interface • Consumer-Producer Pattern • Channels • Worker and Background Tasks
  • 9. Pros • Easy to integrate with Django • Django-ish routing • Django ORM • Customizable channel layers • Make Django async
  • 10. Cons • Probably only heavy tested with Python and Django users • ASGI is quite new • Too much work just to get websocket working • Channels looks powerful, but complicated
  • 11. Renyi’s Take • Too complicated for prototyping • May be good for R&D • Yes or No ?
  • 13. Tornado • Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.
  • 14. Pros • Built with non-blocking IO in mind. • Many async options, long polling, websockets, coroutines, queues, multi-process, etc. • Lots of batteries, non-blocking HTTP server, async http client, ioloops, iostreams, net utilities, etc. • Play well with others, wsgi (django), twisted, asyncio (python3.5+). • Facebook is among the core developers.
  • 15. Cons • It’s more complicated to setup • It’s harder to design applications around it • Batteries are pretty low level (could be a PRO) • Almost nothing is out-of-the-box (may not be a bad thing)
  • 16. Renyi’s Take • Easy integration with Django (FallbackHandler) • Makes Django async (make it green) • Easy Django + websocket (IOLoop) • A good scalling option for Django projects • Yes or No ?
  • 20. Cons • You really shouldn’t be bothered with this. • If you do, it’s most likely out of the scope of this talk, :p
  • 21. Renyi’s Take What you need to know • Yes. If you have a choice, choose asyncio. • It works well with most web/networking framework. • If not, most popular python frameworks are going to implement it soon. • So, choose a good web framework that uses asyncio. • If you are working on IO stuffs, yes asyncio is really good for your sanity. • Yes or No ?
  • 22. Django + Tornado + Websocket + AsyncIO
  • 23.