Pyramid interface to CubicWeb

cubicweb.pyramid.wsgi_application_from_cwconfig(cwconfig, profile=False, profile_output=None, profile_dump_every=None, debugtoolbar=False)[source]

Build a WSGI application from a cubicweb configuration

  • cwconfig – A CubicWeb configuration

  • profile – Enable profiling. See Profiling.

  • profile_output – Profiling output filename. See Profiling.

  • profile_dump_every – Profiling number of requests before dumping the stats. See Profiling.

  • debugtoolbar – Activate pyramid debugtoolbar when True.


A fully operationnal WSGI application

cubicweb.pyramid.wsgi_application(instance_name=None, debug=None)[source]

Build a WSGI application from a cubicweb instance name

  • instance_name – Name of the cubicweb instance (optional). If not provided, CW_INSTANCE must exists.

  • debug – Enable/disable the debug mode. If defined to True or False, overrides CW_DEBUG.

The following environment variables are used if they exist:


A CubicWeb instance name.


If defined, the debugmode is enabled.

The function can be used as an entry-point for third-party wsgi containers. Below is a sample uswgi configuration file:

http =
env = CW_INSTANCE=myinstance
env = CW_DEBUG=1
module = cubicweb.pyramid:wsgi_application()
virtualenv = /home/user/.virtualenvs/myvirtualenv
processes = 1
threads = 8
stats =
plugins = http,python