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

Django - A framework for prototypes with deadlines

Django - A framework for prototypes with deadlines

Hands on with python's most-used web framework: did you ever wonder how some developers are able to deploy web apps so fast? While you are still writing your SQL queries to retrieve some data from the database they are already tinkering with the color of their front end buttons. Meet Django, the python framework for web developers with deadlines. In this session we will write our first simple Django app, explore the features of the Django ORM and see how you can write front-end templates.

Marcel Neidinger

January 28, 2021
Tweet

More Decks by Marcel Neidinger

Other Decks in Programming

Transcript

  1. Marcel Neidinger
    API & Programmability Lead,
    Cisco EMEAR Systems Engineering
    28.01.2021
    A framework for prototypes with deadlines
    Django

    View Slide

  2. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 2
    what is django
    django is an open source web
    framework – written in python –
    that follows the Model-View-
    Template (MVT) methodology and
    offers a Object-Relational Mapping
    (ORM) that can interact with a wide
    range of database systems. It pitches
    itself as suited for rapidly
    developing production-ready web
    applications.
    django

    View Slide

  3. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 3
    what is django
    “web framework”

    View Slide

  4. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 4
    what is django
    building a web app
    means
    database
    front-end
    admin
    API
    routing
    etc.

    View Slide

  5. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 5
    insanity.

    View Slide

  6. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 6
    Framework
    write it once and be done with it.

    View Slide

  7. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7
    what is django
    “Model-View-Template”

    View Slide

  8. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 8
    what is django
    A wild request
    appears
    get data
    change data
    display data

    View Slide

  9. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 9
    what is django
    get data
    change data
    display data
    model

    View Slide

  10. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 10
    what is django
    get data
    change data
    display data
    view

    View Slide

  11. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 11
    what is django
    get data
    change data
    display data
    template

    View Slide

  12. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 12
    Model-View-Template
    Split the request into different repeatable parts

    View Slide

  13. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 13
    what is django
    “Object-Relational Mapping”

    View Slide

  14. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 14
    what is django
    SELECT * FROM
    User WHERE id=42

    View Slide

  15. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 15
    insanity.

    View Slide

  16. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 16
    what is django
    We all prefere
    objects
    ORM
    User
    +id:str
    +name:str
    +email:str
    CREATE TABLE User()

    View Slide

  17. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 17
    what is django
    We all prefere
    objects
    ORM
    User
    +id:str
    +name:str
    +email:str
    SELECT * FROM User()

    View Slide

  18. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 18
    Object-Relational-Mapping
    Writing SQL is overated. OOP is where it’s at.

    View Slide

  19. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 19
    what is django
    “rapidly developing”

    View Slide

  20. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 20
    what is django
    A (very) simple
    guestbook
    save entries
    display entries
    delete entries

    View Slide

  21. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 21
    guestbook.ai
    The multi-billion dollar IPO is coming in 2024

    View Slide

  22. View Slide

  23. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 23
    • Writing your first django app - part 1
    https://docs.djangoproject.com/en/3.1/intro/tutorial01/
    Where to go now

    View Slide

  24. © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 24
    • Cover image: Photo by Stephan Seeber from Pexels
    Image Credit

    View Slide