class documentation
class Site(HTTPFactory): (source)
Constructor: Site(resource, requestFactory, *args, **kwargs)
Implements interfaces: twisted.internet.interfaces.IProtocolNegotiationFactory
A web site: manage log, sessions, and resources.
Method | __getstate__ |
Undocumented |
Method | __init__ |
No summary |
Method | acceptable |
Protocols this server can speak. |
Method | build |
Generate a channel attached to this site. |
Method | get |
Emulate a resource's getChild method. |
Method | get |
Get a resource for a request. |
Method | get |
Get a previously generated session. |
Method | make |
Generate a new Session instance, and store it for future reference. |
Method | render |
Redirect because a Site is always a directory. |
Class Variable | is |
Undocumented |
Instance Variable | counter |
The number of sessions that have been generated. |
Instance Variable | display |
If set, unhandled exceptions raised during rendering are returned to the client as HTML. Default to False. |
Instance Variable | request |
A factory which is called with (channel) and creates Request instances. Default to Request . |
Instance Variable | resource |
Undocumented |
Instance Variable | session |
Deprecated and unused. See Session.sessionTimeout instead. |
Instance Variable | session |
factory for sessions objects. Default to Session . |
Instance Variable | sessions |
Mapping of session IDs to objects returned by sessionFactory. |
Method | _mkuid |
(internal) Generate an opaque, unique ID for a user's session. |
Method | _open |
Override in subclasses, e.g. to use twisted.python.logfile . |
Inherited from HTTPFactory
:
Method | log |
Write a line representing request to the access log file. |
Method | start |
Set up request logging if necessary. |
Method | stop |
This will be called before I stop listening on all Ports/Connectors. |
Class Variable | log |
A file (object with write(data: str) and close() methods) that will be used for logging HTTP requests and responses in the standard Combined Log Format . |
Instance Variable | log |
Undocumented |
Instance Variable | reactor |
An IReactorTime provider used to manage connection timeouts and compute logging timestamps. |
Instance Variable | time |
Undocumented |
Method | _get_log |
Undocumented |
Method | _get_log |
Undocumented |
Method | _update |
Update log datetime periodically, so we aren't always recalculating it. |
Instance Variable | _log |
A cached datetime string for log messages, updated by _logDateTimeCall. |
Instance Variable | _log |
A delayed call for the next update to the cached log datetime string. |
Instance Variable | _log |
Undocumented |
Instance Variable | _log |
See the logFormatter parameter to __init__ |
Instance Variable | _nativeize |
A flag that indicates whether the log file being written to wants native strings (True) or bytes (False). This is only to support writing to twisted.python.log which, unfortunately, works with native strings. |
Inherited from Factory
(via HTTPFactory
, ServerFactory
):
Class Method | for |
Create a factory for the given protocol. |
Method | do |
Make sure startFactory is called. |
Method | do |
Make sure stopFactory is called. |
Method | log |
Describe this factory for log messages. |
Class Variable | noisy |
Undocumented |
Class Variable | protocol |
Undocumented |
Instance Variable | num |
Undocumented |
overrides
twisted.web.http.HTTPFactory.__init__
Parameters | |
resource:IResource provider | The root of the resource hierarchy. All request traversal for requests received by this factory will begin at this resource. |
request | Overwrite for default requestFactory. |
*args | Undocumented |
**kwargs | Undocumented |
See Also | |
twisted.web.http.HTTPFactory.__init__ |
Get a resource for a request.
This iterates through the resource hierarchy, calling getChildWithDefault on each resource it finds for a path element, stopping when it hits an element where isLeaf is true.
If set, unhandled exceptions raised during rendering are returned to the client as HTML. Default to False.