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

Introduction to django

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

Introduction to django

My first presentation- On July 1, 2013 with Jasvir Singh at TCC, Guru Nanak Dev Engineering College.

Avatar for kamaljeet Kaur

kamaljeet Kaur

July 01, 2013

Other Decks in Programming

Transcript

  1. What is django? Django is a free, open source web

    application framework, written in Python, which follows the model–view– controller architectural pattern.
  2. Features of django: • Clean URLs • Object- Relational Mapping

    • Loosely coupled components • Designer-friendly templates • Cache framework • MVC architecture • Jython support • DRY ( Don't Repeat Yourself)
  3. URL dispatch provides a simple way to map URLs to

    view code using a simple pattern matching language. An ordered set of patterns is checked one-by-one. If one of the patterns matches the path information associated with a request, a particular view callable is invoked. URL dispatching:
  4. Models: • Generally, each model maps to a single database

    table. • Each attribute of the model represents a database field.
  5. Views: A view is a Python function that takes a

    Web request and returns a Web response.
  6. Templates: Templates are user interface of application, encouraging a clean

    separation of application and presentation logic. Templates can be maintained by anyone with an understanding of HTML; no knowledge of Python is required.
  7. Templates: Quick Example {% if latest_poll_list %} <ul> {% for

    poll in latest_poll_list %} <li><a href="/admin/{{ poll.id }}/">{{ poll.question }}</a></li> {% endfor %} </ul> {% else %} <p>No polls are available.</p> {% endif %}
  8. Why django? • Django keeps your website up and avoids

    unnecessary crashes. • Admin interfaces are easy. • Django builds large websites quickly. • It is fast as compared to other frameworks. • Emphasizes reusability.