My problem comes from this code in Kotti, that assumes that all system variables (presented as event, in this case), have the renderer_name keyword. Even a None value as renderer_name would suffice, in this case:
def add_renderer_globals(event):
if event['renderer_name'] != 'json':
request = event['request']
api = getattr(request, 'template_api', None)
if api is None and request is not None:
api = template_api(event['context'], event['request'])
event['api'] = api
The bug is in this function in config.py
The system variable that is passed to the renderer needs to have the renderer_name key, according to the documentation here: http://docs.pylonsproject.org/projects/pyramid/en/master/narr/templates.html#system-values-used-during-rendering
My problem comes from this code in Kotti, that assumes that all system variables (presented as event, in this case), have the renderer_name keyword. Even a None value as renderer_name would suffice, in this case: