Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Beyond Web 2.0 - Django and Python in the modern web ecosystem

Beyond Web 2.0 - Django and Python in the modern web ecosystem

Django is over 10 years old; but the web that it was built for - the world of "Web 2.0" - doesn't really exist any more. Yes, we still need to rapidly develop database-backed websites, AJAX-enabled, but the modern web is faced with new problems and new challenges. Many of those challenges involve interacting with devices that aren't desktop machines, and platforms that aren't a traditional browser - places where Python isn't a first-class citizen.

Does this mean we have to abandon Django and Python for other frameworks and languages? Can we keep using Python and Django on the server side and interact with independent client side frameworks? Or can we push Python and Django into these new environments?

In this talk, Dr Russell Keith-Magee will explore the problems, and the potential solutions, to these problems.

Video:
Video: http://opbeat.com/community/posts/beyond-web-2-0-django-and-python-in-the-modern-web-ecosystem-by-russell-keith-magee/

B91373320dbc3bc52fcd870d3b21748f?s=128

Russell Keith-Magee

April 01, 2016
Tweet

Transcript

  1. Beyond Web 2.0: Django and Python in the modern Web

    ecosystem Dr Russell Keith-Magee DjangoCon Europe 2016
  2. Beyond Web 2.0: Django and Python in the modern Web

    ecosystem Dr Russell Keith-Magee DjangoCon Europe 2016
  3. None
  4. None
  5. None
  6. Quo vadimus?

  7. 2005

  8. A Django project, c.2005 Browser

  9. A Django project, c.2005 Models Browser

  10. A Django project, c.2005 Views Models Browser

  11. A Django project, c.2005 Forms V Views Models Browser

  12. A Django project, c.2005 URLs Forms V Views Models Browser

  13. A Django project, c.2005 Template URLs Forms V Views Models

    Browser
  14. A Django project, c.2005 Template URLs Forms V Views Models

    memcached Browser
  15. A Django project, c.2016 Template URLs Forms V Views Models

    memcached Browser
  16. A Django project, c.2016 Template URLs Forms V Views Models

    memcached Browser V
  17. A Django project, c.2016 Template URLs Forms V Views Models

    memcached API V Browser V
  18. A Django project, c.2016 Template URLs Forms V Views Models

    memcached API API V Browser V V  V
  19. A Django project, c.2016 Template URLs Forms V Views Models

    memcached API API V Browser V V  V
  20. A Django project, c.2016 Template URLs Forms V Views Models

    memcached API API V Browser V V  V
  21. Rich client frameworks

  22. Isomorphic Javascript Development

  23. Integrating with Python

  24. Isomorphic Javascript Development

  25. Isomorphic Javascript Development

  26. Analyse requirements Browser

  27. Analyse requirements Browser

  28. Analyse requirements Browser

  29. Analyse requirements V Browser V

  30. Analyse requirements V Browser V V  V

  31. Everything old is new again

  32. Revised Web app structure V Models Browser V V 

    V
  33. Revised Web app structure V Models Browser V Views V

     V
  34. Revised Web app structure Controller V Models Browser V Views

    V  V
  35. Model - View - Controller

  36. API-first development

  37. High latency connections or No connection at all

  38. Python in the browser

  39. Brython Skulpt PyPy.js

  40. Example <p>Name: <input id="data"> <button id="test">Click!</button> </p> <script type="text/python"> from

    browser import document as doc, alert def echo(*args): alert("Hello %s !" % doc["data"].value) doc["test"].bind("click", echo) </script>
  41. Analysing requirements

  42. .pyc files and bytecode

  43. Batavia

  44. Example >>> def clean(username): ... return username.lower() >>> clean.__code__ <code

    object clean at 0x.....> >>> clean.__code__.co_code b'|\x00\x00j\x00\x00\x83\x00\x00S' >>> import base64 >>> base64.encodebytes(clean.__code__.co_code) b'fAAAagAAgwAAUw==\n'
  45. Example: DOM access import dom div = dom.document.getElementById('output') div.innerHTML =

    div.innerHTML + '\n\nHello, World!\n\n'
  46. Unexpected consequences

  47. Python on Mobile devices

  48. Native iOS applications

  49. Rubicon NSURL = ObjCClass("NSURL") # [NSURL URLWithString:@"http://pybee.org"]; NSURL.URLWithString_("http://pybee.org/") class Handler(NSObject):

    @objc_method def pokeWithValue_(self, v: int) -> None: print("Poking with", v) # Handler *hndl = [[Handler alloc] init]; hndl = Handler.alloc().init() # [hndl pokeWithValue:37]; hndl.pokeWithValue_(37)
  50. Native Android applications

  51. VOC

  52. Kivy

  53. Toga

  54. Toga for web?

  55. freakboy3742.pythonanyware.com

  56. Ágætis byrjun

  57. Possible isn't enough

  58. Boiling a frog

  59. russell@keith-magee.com @freakboy3742 cecinestpasun.com pybee.org freakboy3742.pythonanyware.com