Disabling debugtoolbar causes Mako errors

301 views Asked by At

I have a Pyramid application that works totally fine when my settings.ini file contains:

pyramid.includes =
    pyramid_debugtoolbar
    pyramid_tm

But if I change things to:

pyramid.includes =
    pyramid_tm

This happens:

Traceback (most recent call last):
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/waitress-0.8.8-py2.7.egg/waitress/channel.py", line 337, in service
    task.service()
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/waitress-0.8.8-py2.7.egg/waitress/task.py", line 173, in service
    self.execute()
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/waitress-0.8.8-py2.7.egg/waitress/task.py", line 392, in execute
    app_iter = self.channel.server.application(env, start_response)
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/pyramid-1.5a4-py2.7.egg/pyramid/router.py", line 272, in __call__
    response = self.invoke_subrequest(request, use_tweens=True)
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/pyramid-1.5a4-py2.7.egg/pyramid/router.py", line 247, in invoke_subrequest
    response = handle_request(request)
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/pyramid_fanstatic-0.5-py2.7.egg/pyramid_fanstatic/__init__.py", line 64, in __call__
    response = self.handler(request)
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/pyramid-1.5a4-py2.7.egg/pyramid/tweens.py", line 21, in excview_tween
    response = handler(request)
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/pyramid_tm-0.7-py2.7.egg/pyramid_tm/__init__.py", line 82, in tm_tween
    reraise(*exc_info)
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/pyramid_tm-0.7-py2.7.egg/pyramid_tm/__init__.py", line 63, in tm_tween
    response = handler(request)
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/pyramid-1.5a4-py2.7.egg/pyramid/router.py", line 163, in handle_request
    response = view_callable(context, request)
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/pyramid-1.5a4-py2.7.egg/pyramid/config/views.py", line 377, in rendered_view
    context)
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/pyramid-1.5a4-py2.7.egg/pyramid/renderers.py", line 416, in render_view
    return self.render_to_response(response, system, request=request)
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/pyramid-1.5a4-py2.7.egg/pyramid/renderers.py", line 439, in render_to_response
    result = self.render(value, system_values, request=request)
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/pyramid-1.5a4-py2.7.egg/pyramid/renderers.py", line 419, in render
    renderer = self.renderer
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/pyramid-1.5a4-py2.7.egg/pyramid/decorator.py", line 37, in __get__
    val = self.wrapped(inst)
  File "/home/pharm/big_data/local/lib/python2.7/site-packages/pyramid-1.5a4-py2.7.egg/pyramid/renderers.py", line 402, in renderer
    'No such renderer factory %s' % str(self.type))
ValueError: No such renderer factory .mak

I would love to know why.

To paraphrase:

The question is why this happens, not how to fix it... mako is used in the project and it all works fine. That error happened only when I disabled the debugtoolbar. So the debugtoolbar somehow makes mako available to the application? How?

1

There are 1 answers

0
crucl0 On

Problem is

ValueError: No such renderer factory .mak

Pyramid no longer depends on or configures the Mako and Chameleon templating system renderers by default.

Support for Mako templating has been moved into an add-on package named pyramid_mako, and support for Chameleon templating has been moved into an add-on package named pyramid_chameleon. These packages are drop-in replacements for the old built-in support for these templating langauges. All you have to do is install them and make them active in your configuration to register renderer factories for .pt and/or .mako (or .mak) to make your application work again.

You can read more about it here —> Major Backwards Incompatibilities.