Introduction to Django

Django is a web development framework written in Python used to build dynamic web applications. It is made up of a few major parts.

  • Models - These are how you control all the data in your application. They handle transferring data back and forth from the database into Python objects.
  • Views - These are the interfaces for users of your web application. Each page of your application is generated by a view. Not all views display HTML. Some might display JSON or other file types, and some might process data and redirect the user.
  • Templates - These generate the HTML your users will see. They are made up of a combination of HTML code and the Django template language, a set of tags and filters that conditionally show HTML, iterate through data, and transform data.
  • Forms - These Python classes handle both generating HTML forms and reading in and validating data when the user submits an HTML form. Django forms can generate and save models from HTML form data.

Besides these four major parts, Django includes many utilities to handle common web application problems, such as authentication, an admin interface, tracking user sessions, presenting one-time messages to users, internationalization, sending emails, and more.