$30 off During Our Annual Pro Sale. View Details »

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. The Hitchhiker's Guide to
    Django 2.0

    View Slide

  2. Understanding Audience
    Noobs
    Experts
    Designers

    View Slide

  3. 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

    View Slide

  4. What is Django?

    View Slide

  5. Why is Django so Awesome?
    ● Security
    ● Django Admin
    ● Build in Batteries
    ● Great documentation
    ● Friendly community
    ● Stable
    ● Open source

    View Slide

  6. Django Architecture

    View Slide

  7. The big picture about Django - MVT
    L

    View Slide

  8. How does Django Works?

    View Slide

  9. View Slide

  10. 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

    View Slide

  11. Django 2.0

    View Slide

  12. History
    L

    View Slide

  13. Simplified URL routing syntax
    Django 1.11

    View Slide

  14. Simplified URL syntax
    Django 2.0

    View Slide

  15. Simplified URL routing syntax

    View Slide

  16. Mobile Friendly Admin

    View Slide

  17. 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

    View Slide

  18. When should you move your
    project to Django 2.0?

    View Slide

  19. Supported Versions

    View Slide

  20. New versioning system

    View Slide

  21. Tutorial Recommendation
    Django Girls
    Django tutorial - Polls app

    View Slide

  22. Thanks!
    Contact details:
    Github : @kurianbenoy
    Twitter : @kurianbenoy2
    [email protected]

    View Slide

  23. Question

    View Slide