twisted.web.server.Site(http.HTTPFactory) class documentationtwisted.web.server
View Source
(View In Hierarchy)
A web site: manage log, sessions, and resources.
| Instance Variable | counter | increment value used for generating unique sessions ID. |
| Instance Variable | requestFactory | A factory which is called with (channel, queued) and creates Request instances.
Default to Request. |
| Instance Variable | displayTracebacks | if set, Twisted internal errors are displayed on rendered pages. Default to
True. |
| Instance Variable | sessionFactory | factory for sessions objects. Default to Session. |
| Instance Variable | sessionCheckTime | Deprecated. See Session.sessionTimeout
instead. |
| Method | __init__ | No summary |
| Method | __getstate__ | Undocumented |
| Method | makeSession | Generate a new Session instance, and store it for future reference. |
| Method | getSession | Get a previously generated session. |
| Method | buildProtocol | Generate a channel attached to this site. |
| Method | render | Redirect because a Site is always a directory. |
| Method | getChildWithDefault | Emulate a resource's getChild method. |
| Method | getResourceFor | Get a resource for a request. |
| Method | _openLogFile | Override in subclasses, e.g. to use twisted.python.logfile. |
| Method | _mkuid | (internal) Generate an opaque, unique ID for a user's session. |
Inherited from Factory (via HTTPFactory, ServerFactory):
| Class Method | forProtocol | Create a factory for the given protocol. |
| Method | logPrefix | Describe this factory for log messages. |
| Method | doStart | Make sure startFactory is called. |
| Method | doStop | Make sure stopFactory is called. |
Inherited from Factory (via HTTPFactory, ServerFactory):
| Class Method | forProtocol | Create a factory for the given protocol. |
| Method | logPrefix | Describe this factory for log messages. |
| Method | doStart | Make sure startFactory is called. |
| Method | doStop | Make sure stopFactory is called. |
True.
| Parameters | resource | The root of the resource hierarchy. All request traversal for requests
received by this factory will begin at this resource. (type: IResource
provider) |
| requestFactory | Overwrite for default requestFactory. (type: callable or class.) | |
| See Also | twisted.web.http.HTTPFactory.__init__ | |
Get a resource for a request.
This iterates through the resource heirarchy, calling getChildWithDefault on each resource it finds for a path element, stopping when it hits an element where isLeaf is true.