[skeleton] Add an entry point and configuration for running a Pyramid application
We add a `pyramid_main` function in __init__.py that instantiate the WSGI
application using "cubicweb.pyramid"; this is defined as an entry point (in
setup.py) so that pserve_ can find it.
Alongside comes a development.ini file which includes basic settings so that
running a Pyramid+CubicWeb application works (only the "instance=<appid>" may
be passed as a command-line argument). Logging is also configured there, but
only includes the cube at stake and cubicweb (others could be added if
needed).
.. _perse: \
http://docs.pylonsproject.org/projects/pyramid/en/1.8-branch/pscripts/pserve.html
"""cubicweb-%(cubename)s application package
%(longdesc)s
"""
def pyramid_main(global_config, **settings):
"""Return a Pyramid WSGI application bound to a CubicWeb repository."""
from pyramid.config import Configurator
config = Configurator(settings=settings)
config.include('cubicweb.pyramid')
config.scan()
return config.make_wsgi_app()