Closed GoogleCodeExporter closed 9 years ago
Only mako is supported. But I think you can adapt the template engine in
forms/__init__.py so:
1/ it can render mako template even if you use genshi
2/ it render your genshi templates
I guess 1 is the easy way. You need to set the proper config in pylons to also
support mako template and use
render_mako instead of render in forms/__init__
Feedback welcome.
Original comment by gael.pas...@gmail.com
on 2 Apr 2010 at 10:19
In forms/__init__ I can fix _forms_ rendering, but the issue is in admin
interface,
not just forms.
I added few lines in config.environment module of my project:
== cut ==
...
from mako.lookup import TemplateLookup
from pylons.error import handle_mako_error
...
def load_environment(global_conf, app_conf):
...
# Create the Mako TemplateLookup, with the default auto-escaping
config['pylons.app_globals'].mako_lookup = TemplateLookup(
directories=paths['templates'],
error_handler=handle_mako_error,
module_directory=os.path.join(app_conf['cache_dir'], 'templates'),
input_encoding='utf-8', default_filters=['escape'],
imports=['from webhelpers.html import escape'])
...
== cut ==
and exception (AttributeError: 'Globals' object has no attribute 'mako_lookup')
is
gone, but http://127.0.0.1:5000/admin now returns no response (zero-length
content
returned). I don't know how I can debug as it raises no exception and I'm not
familiar enough with FA/pylons source code to find an issue...
Original comment by mihail.l...@gmail.com
on 2 Apr 2010 at 3:19
try to set an engine attribute to your controller:
class Ctrl(..):
engine = forms.engine
If it does not fix the problem I cant really help without any traceback.
Original comment by gael.pas...@gmail.com
on 2 Apr 2010 at 9:52
I assume that this fix the problem.
Original comment by gael.pas...@gmail.com
on 19 Apr 2010 at 6:28
Original issue reported on code.google.com by
mihail.l...@gmail.com
on 2 Apr 2010 at 9:12