Commit d74ddf57 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[skeleton,pyramid] Move pyramid app definition in cubicweb.pyramid module

The application definition is actually not specific to the final "cube" being
bootstrapped from skeleton. This patch thus move the pyramid application
function into cubicweb.pyramid module and let cubicweb register the
"paste.app_factory" entry point (instead of the bootstrapped cube).

Useless call to `config.scan` is dropped along the way.
parent 83739be20fab
......@@ -166,6 +166,13 @@ def wsgi_application(instance_name=None, debug=None):
return wsgi_application_from_cwconfig(cwconfig)
def pyramid_app(global_config, **settings):
"""Return a Pyramid WSGI application bound to a CubicWeb repository."""
config = Configurator(settings=settings)
config.include('cubicweb.pyramid')
return config.make_wsgi_app()
def includeme(config):
"""Set-up a CubicWeb instance.
......
......@@ -2,12 +2,3 @@
%(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()
......@@ -4,7 +4,7 @@
###
[app:main]
use = egg:%(distname)s
use = egg:cubicweb#main
pyramid.reload_templates = true
pyramid.debug_authorization = false
......
......@@ -77,9 +77,6 @@ setup(
'cubicweb.cubes': [
'%(cubename)s=cubicweb_%(cubename)s',
],
'paste.app_factory': [
'main=cubicweb_%(cubename)s:pyramid_main',
],
},
zip_safe=False,
)
......@@ -204,6 +204,11 @@ setup(
'Markdown',
'unittest2 >= 0.7.0',
],
entry_points={
'paste.app_factory': [
'main=cubicweb.pyramid:pyramid_app',
],
},
extras_require={
'captcha': [
'Pillow',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment