NelsonLabs
Django/What is Django?

What is Django?

Django is a full-featured Python web framework that follows the 'batteries included' philosophy โ€” routing, database ORM, admin panel, authentication, forms, security protections โ€” all built in. You write the business logic; Django handles everything else.

ANALOGY

Django is a prefabricated house kit. You could build a house from raw bricks. Or you could buy a kit with pre-made walls, windows, a roof, and plumbing โ€” you just assemble and customise. Django is that kit for web applications. The foundation, routing system, database layer, and admin dashboard are already built. You focus on the rooms โ€” your specific features.

The MVT pattern

Django follows MVT: Model (data and database), View (business logic and response), Template (HTML for the browser). The URL router maps URLs to views โ€” similar to MVC (Model-View-Controller) but Django calls the controller a 'view' and the view a 'template'.

Model
Defines your data structure. Django auto-generates database tables from your Python class definitions.
View
Handles the request. Fetches data from Models, passes it to a Template, and returns a response.
Template
HTML file with template tags. Receives data from the View and renders the final HTML.
URL Router
Maps URL patterns to View functions. Like a switchboard connecting incoming requests to the right handler.