App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | List of all members
google.appengine.tools.devappserver2.url_handler.URLHandler Class Reference
Inheritance diagram for google.appengine.tools.devappserver2.url_handler.URLHandler:
google.appengine.tools.devappserver2.url_handler.UserConfiguredURLHandler google.appengine.tools.devappserver2.wsgi_handler.WSGIHandler google.appengine.tools.devappserver2.module._ScriptHandler google.appengine.tools.devappserver2.static_files_handler.StaticContentHandler google.appengine.tools.devappserver2.static_files_handler.StaticDirHandler google.appengine.tools.devappserver2.static_files_handler.StaticFilesHandler

Public Member Functions

def __init__
 
def match
 
def handle_authorization
 
def handle
 

Detailed Description

Abstract base class for subclasses that handle HTTP requests for a URL.

Constructor & Destructor Documentation

def google.appengine.tools.devappserver2.url_handler.URLHandler.__init__ (   self,
  url_pattern 
)
Initializer for URLHandler.

Args:
  url_pattern: A re.RegexObject that matches URLs that should be handled by
  this handler. It may also optionally bind groups.

Member Function Documentation

def google.appengine.tools.devappserver2.url_handler.URLHandler.handle (   self,
  match,
  environ,
  start_response 
)
Serves the content associated with this handler.

Args:
  match: The re.MatchObject containing the result of matching the URL
against this handler's URL pattern.
  environ: An environ dict for the current request as defined in PEP-333.
  start_response: A function with semantics defined in PEP-333.

Returns:
  An iterable over strings containing the body of the HTTP response.
def google.appengine.tools.devappserver2.url_handler.URLHandler.handle_authorization (   self,
  environ,
  start_response 
)
Handles the response if the user is not authorized to access this URL.

If the user is authorized, this method returns None without side effects.
The default behaviour is to always authorize the user.

If the user is not authorized, this method acts as a WSGI handler, calling
the start_response function and returning the message body. The response
will either redirect to the login page, or contain an error message, as
specified by the 'auth_fail_action' setting.

Args:
  environ: An environ dict for the current request as defined in PEP-333.
  start_response: A function with semantics defined in PEP-333.

Returns:
  An iterable over strings containing the body of an HTTP response, if the
  authorization check fails or the login UI must be displayed. None if the
  user is authorized to access the resource.
def google.appengine.tools.devappserver2.url_handler.URLHandler.match (   self,
  url 
)
Tests whether a given URL string matches this handler.

Args:
  url: A URL string to match.
Returns:
  A re.MatchObject containing the result of the match, if the URL string
  matches this handler. None, otherwise.

The documentation for this class was generated from the following file: