---
source: https://iinventedlight.com/library/notes/django-views.md
title: "A Django view takes a request and returns a response"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (django/django); prose restates cited source lines in own words"
license_family: django-bsd3
attribution: "Summary by iinventedlight (AI-assisted). Sources: Django docs, Writing views, BSD-3-Clause (django/django); Django source, django.views.generic.base.View, BSD-3-Clause (django/django). Notices: Django documentation and source (django/django): Copyright (c) Django Software Foundation and individual contributors; BSD-3-Clause (https://raw.githubusercontent.com/django/django/stable/6.1.x/LICENSE)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-10
status: published
approved_by: "Cole Withington, 2026-11-10 10:08 PT, Librarian chat widget t33s2: \"Yes, publish all 25 Django and Vue drafts\""
checked_on: 2026-11-10
as_of: 2026-11-10
confidence: medium
untested: "No Django project was run for this note; only the fetched documentation and source files were read."
category: coding-references
topic_area: "code-backend: Django views"
tags: [django, views, http, request]
client: Librarian
sources:
  - id: S1
    title: "Writing views"
    publisher: Django docs
    url: https://docs.djangoproject.com/en/6.1/topics/http/views/
    accessed: 2026-11-10
    license: "BSD-3-Clause"
  - id: S2
    title: "django.views.generic.base.View"
    publisher: Django source
    url: https://github.com/django/django/blob/stable/6.1.x/django/views/generic/base.py
    accessed: 2026-11-10
    license: "BSD-3-Clause"
---
# A Django view takes a request and returns a response

**Answer:** A Django view is a Python function that takes a web request and returns a web response. The response may be HTML, a redirect, a 404, XML, an image, or anything else.

## Function views

The view contains logic necessary to return that response. Each view function takes an `HttpRequest` as its first parameter, typically named `request`. The name of the view function doesn’t matter.

## Class-based views

`django.views.generic.base.View` is an intentionally simple parent class for all views. It implements dispatch-by-method and simple sanity checking. Its constructor is called from the URLconf and can take extra keyword arguments.

## See also

- [django-url-dispatcher](https://iinventedlight.com/library/notes/django-url-dispatcher/)
- [django-request-response](https://iinventedlight.com/library/notes/django-request-response/)

## Claims

- id: C1
  claim: A view is a Python function, also called a view function.
  source: S1
  evidence: "A view function, or view for short, is a Python function"

- id: C2
  claim: A view takes a web request and returns a web response.
  source: S1
  evidence: "that takes a web request and returns a web response."

- id: C3
  claim: The first parameter of a view is an HttpRequest.
  source: S1
  evidence: "Each view function takes an HttpRequest object as its first parameter,"

- id: C4
  claim: View is the intentionally simple parent class for all class-based views.
  source: S2
  evidence: "Intentionally simple parent class for all views."

## Sources

- [S1] Writing views. Django docs. https://docs.djangoproject.com/en/6.1/topics/http/views/ . License: BSD-3-Clause. Accessed 2026-11-10.

- [S2] django.views.generic.base.View. Django source. https://github.com/django/django/blob/stable/6.1.x/django/views/generic/base.py . License: BSD-3-Clause. Accessed 2026-11-10.


License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources and notices: Django documentation and source (django/django): Copyright (c) Django Software Foundation and individual contributors; BSD-3-Clause (https://raw.githubusercontent.com/django/django/stable/6.1.x/LICENSE). Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
