View function
A view function is a web request handler associated with a route that receives a request and returns an HTTP response.
Django in Action
A Django view is a function or class that receives an HTTP request and returns an HTTP response.
- How it is used
- Connects visited URLs to code that generates browser pages or API data.
- How deep it goes
- Defines function-based view inputs and outputs, then works through plain-text and ORM-backed rendering without class-based view internals.
- Examples
- Uses a plain-text credits page and a musician listing ordered by last name.
- What you can do after
- Build it from scratch as a request-taking function, register it with a URL path, and return content to a browser.
Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI
A view function is a Flask request-handler function that processes a web request and returns a response or rendered page.
- How it is used
- Routes browser requests to rendered pages and prediction-processing actions in a Flask web deployment.
- How deep it goes
- Explains routing, template rendering, query parsing, type conversion, model invocation, and result display, while deferring robust bin calculation.
- Examples
- Uses home.html and show-prediction.html handlers for a property-price prediction form with categorical and continuous fields.
- What you can do after
- Apply it via Flask to render pages, collect request inputs, call a loaded Keras model, and display predictions.
Read how Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI explains view function →
What to know first
- HTMLHTML is the standard markup language for structuring content and elements in documents on the web.
- JavaScriptJavaScript is a high-level, dynamically typed programming language standardized as ECMAScript and used for web and general-purpose programming.
- routingRouting is the process of directing an item, request, or task to a destination or processing path according to relevant rules or characteristics.
- uriA URI is a standardized sequence of characters that identifies a resource by name, location, or both.
Related concepts
- Django ORMuses · Django ORM is Django’s object-relational mapping system for defining models and querying and persisting relational database records through Python objects.
- Django Ninjaused by · Django Ninja is a Python web framework for building APIs with Django using type annotations and typed request and response schemas.
- HTMXused by · HTMX is a JavaScript library that enables HTML attributes to initiate HTTP interactions, handle events, and update portions of a page.
- endpointincludes · An endpoint is a network-accessible address or interface through which a service exposes a resource or operation and handles requests.
- HTTP responseproduces · An HTTP response is a protocol message returned by a server to a client in reply to a request, containing a status code and optionally headers and a body.
- login_requiredconfigured by · login_required is a web-framework decorator that restricts a view or route to authenticated users and redirects unauthenticated requests to a login page.
Questions about view function
What is view function?
A view function is a web request handler associated with a route that receives a request and returns an HTTP response.
Which Manning books explain view function?
Django in Action and Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI.
What should I know before learning view function?
Manning books that teach view function usually introduce HTML, JavaScript, routing and uri first.
What kinds of view function are there?
Kinds of view function include endpoint.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

