The web.wsgi.environment module provides one class Environment which adds the following information to the environ dictionary based on the parameters specified in the class constructor.
environ['web.environment.name'] 
environ['web.environment.type']'database'
Middleware or applications further down the chain can access these variables as follows:
import web.wsgi.base, web.wsgi.environment
class Application(web.wsgi.base.BaseApplication):
    def start(self):
        self.output('<html>')
        self.output('<p>Name: %s</p>'%self.environ['web.environment.name'])
        self.output('<p>Type: %s</p>'%self.environ['web.environment.type'])
        self.output('</html>')
application = web.wsgi.environment.Environment(
    Application(),
    name='testEnv',
    type='database',
)