websauna.system.http.utils module

websauna.system.http.utils.make_routable_request(dbsession=None, registry=None, path='/')[source]

Creates a dummy request that has route_url and other routing methods.

As this request does not get HTTP hostname and such stuff from WSGI environment, a configuration variable websauna.site_url is passed as the base URL.

See also make_dummy_request().

TODO: Split this to two different functions: one for existing dbsession and one for where dbsession is connected.

  • dbsession (Optional[Session]) – Use existing dbsession or set to None to generate a new dbsession and transaction manager. None that this TM is not the thread local transaction manager in transaction.mananger.

  • registry (Optional[Registry]) – Configuration registry

  • path – Path being requested.

Return type



Current request.