Quick start¶
Prerequites¶
Install the pyramid flavour of CubicWeb (here with pip, possibly in a virtualenv):
pip install cubicweb
Instance creation and running¶
In backwards compatible mode¶
In this mode, you can simply create an instance of kind all-in-one
with
the cubicweb-ctl create
command. You’ll then need to add a pyramid.ini
file in your instance directory, see Pyramid Settings file for details about the
content of this file.
Start the instance with the ‘pyramid’ command instead of ‘start’:
cubicweb-ctl pyramid --debug myinstance
Without backwards compatibility¶
In this mode, you can create an instance of kind pyramid
as follow:
cubicweb-ctl create -c pyramid <cube_name> <instance_name>
This will bootstrap a development.ini
file typical of a Pyramid
application in the instance’s directory. The new instance may then be launched
by any WSGI server, for instance with pserve:
pserve etc/cubicweb.d/<instance_name>/development.ini
In a pyramid application¶
Create a pyramid application
Include cubicweb.pyramid:
def includeme(config): # ... config.include('cubicweb.pyramid') # ...
Configure the instance name (in the .ini file):
cubicweb.instance = myinstance
Configure the base-url in all-in-one.conf to match the ones of the pyramid configuration (this is a temporary limitation).