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

The Hitchikers Guide to Django2

The Hitchikers Guide to Django2

This was a introduction to latest version of Django2

Kurian Benoy

July 07, 2018
Tweet

More Decks by Kurian Benoy

Other Decks in Programming

Transcript

  1. Talk Outline • What is Django and why use Django?

    • Django architecture - MVT kind of MVC • How does Django works? • Simplified URL routing syntax in Django2 • Other new features in Django2 • When should you move your old project to Django2
  2. Why is Django so Awesome? • Security • Django Admin

    • Build in Batteries • Great documentation • Friendly community • Stable • Open source
  3. 1. The browser sends request to your web server 2.

    Your web browser sends request to Web Server Gateway interface(WSGI) or directly serves to a HTML file 3. Unlike a web server , WSGI servers can run Python applications. The request populates a Python Dictionalry called environ , and passes several layers of middlewares, begore reaching your django application. 4. URL conf module which contains the urls.py of your project select a view to handle the request based on the requested URL. The requested view will be turned to HttpRequest, a Python object 5. The selected view typically does one or more of things : a) Talks to a database via models b) Renders HTML or any formatted response using templates c) Raise exception 6. The HttpResponse object gets rendered into string , it leaves django application 7. A beautifully rendered web page is seen
  4. Working Asynchronously • What if your server ends up waiting

    for a single request for a long time? • You are wasting your valuable time • Working asynchronously by celery, Django channel possible • Django channels 2 was released using python 3 async and await method