Class subdomain_application
source code
application --+
|
subdomain_application
Application to delegate requests based on the host.
>>> urls = ("/hello", "hello")
>>> app = application(urls, globals())
>>> class hello:
... def GET(self): return "hello"
>>>
>>> mapping = (r"hello\.example\.com", app)
>>> app2 = subdomain_application(mapping)
>>> app2.request("/hello", host="hello.example.com").data
'hello'
>>> response = app2.request("/hello", host="something.example.com")
>>> response.status
'404 Not Found'
>>> response.data
'not found'
|
|
|
|
|
|
|
Inherited from application:
__init__,
add_mapping,
add_processor,
browser,
cgirun,
get_parent_app,
handle_with_processors,
internalerror,
load,
notfound,
request,
run,
wsgifunc
|