Professional Documents
Culture Documents
INT253
INT253
WEB DEVELOPMENT IN
PYTHON USING
.
DJANGO
Introduction
• Django is a high-level Python web framework that encourages rapid
development and clean, pragmatic design.
• It follows the Model-View-Controller (MVC) architectural pattern,
with slight variations, and it's known for its simplicity, flexibility, and
scalability.
MVC Architecture
• Framework is the architectural /design pattern that separates an
application into three main logical component Model,View and
Controller
• It provides a clear separation of business logic,UL logic and input
logic.
• It offers full control on the HTML and URL which make it easy design
web application architecture.
• It is a powerful URL mapping component
Components of MVC Architecture
.
Working of MVC Architecture
• Assume End user sends a request to server to get a
list of student studying in a class
• Server send request to particular
controller(handles student)
• Controller request the model handling students to
return a list of all student studing in a class
• Model query the database for list of students and
returning the list back to controller
• Response from model was successful,controller
ask for view associated with student to return a
presentation of list of students
• View take list of students from controller and
render the list into HTML that used by the browser
• Controller take presentation and return back to
user
Key components with Django
1. Models:
• Django models represent the data structure of the application, defining
the schema for the database tables.
• Models are defined as Python classes, and Django automatically
generates database tables based on these classes.
2. Views
• Views handle the logic of processing a user's request and returning an
appropriate response.
• Views can be simple functions or classes and are responsible for
processing data, interacting with models, and rendering templates.
3.Templates: