Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`web`.`pages``

module documentation
(source)

Utility implementations of `IResource`.

Function | `errorPage` | Build a resource that responds to all requests with a particular HTTP status code and an HTML body containing some descriptive text. This is useful for rendering simple error pages.
Function | `forbidden` | Generate an `IResource` with a 403 Forbidden status code.
Function | `notFound` | Generate an `IResource` with a 404 Not Found status code.
Class | `_ErrorPage` | `_ErrorPage` is a resource that responds to all requests with a particular (parameterized) HTTP status code and an HTML body containing some descriptive text. This is useful for rendering simple error pages.

def errorPage(code, brief, detail): (source)

Build a resource that responds to all requests with a particular HTTP status code and an HTML body containing some descriptive text. This is useful for rendering simple error pages.

The resource dynamically handles all paths below it. Use `IResource.putChild()` override specific path.

Parameters
code:`int` | An integer HTTP status code which will be used for the response.
brief:`str` | A short string which will be included in the response body as the page title.
detail:`str` | A longer string which will be included in the response body.
Returns
`IResource` | An `IResource`

def forbidden(brief='Forbidden Resource', message='Sorry, resource is forbidden.'): (source)

Generate an `IResource` with a 403 Forbidden status code.

Parameters
brief:`str` | A longer string displayed in the page body.
message:`str` | Undocumented
Returns
`IResource` | An `IResource`
See Also
`twisted.web.pages.errorPage`

def notFound(brief='No Such Resource', message='Sorry. No luck finding that resource.'): (source)

Generate an `IResource` with a 404 Not Found status code.

Parameters
brief:`str` | A longer string displayed in the page body.
message:`str` | Undocumented
Returns
`IResource` | An `IResource`
See Also
`twisted.web.pages.errorPage`