Questions tagged [cheetah]

Cheetah is an Open Source Python based Templating Framework.

Cheetah is an open source template engine and code generation tool, written in Python. It can be used standalone or combined with other tools and frameworks. Web development is its principle use, but Cheetah is very flexible and is also being used to generate C++ game code, Java, sql, form emails and even Python code.

from CheetahTemplate.org

It works with Python 2.7 and 3.4+. Wheels are available at PyPI. Issues and pull requests are accepted at GitHub.

69 questions
11
votes
2 answers

Python: format string with custom delimiters

EDITED I have to format a string with values from a dictionary but the string already contains curly brackets. E.g.: raw_string = """ DATABASE = { 'name': '{DB_NAME}' } """ But, of course, raw_string.format(my_dictionary) results in…
Don
  • 15,148
  • 9
  • 55
  • 91
7
votes
1 answer

HTML/CSS/JS Syntax Highlighting in Eclipse

Hello How can I enable syntax highlighting for HTML/CSS/JS in Eclipse I am mainly developing in python using the PyDev package but right now I am creating Cheetah templates and they are very hard to read unhighlighted. Any plugin/package suggestions…
BillPull
  • 8,335
  • 15
  • 54
  • 93
5
votes
1 answer

Using Cheetah Templating system with windows and python 2.6.1 (namemapper problem)

So I am trying to use the Cheetah templating engine in conjunction with the Django web framework, and that is actually working fine. I did some simple tests with that and I was able to render pages and whatnot. However, problems arise whenever…
Daniel Waltrip
  • 2,220
  • 3
  • 22
  • 28
4
votes
2 answers

Python shared libraries - Cheetah namemapper.so not found

I'm using Python Cheetah for template generation and I can't get it to use the compiled _namemapper.so library that is installed. I am running on CentOS 5.4 with Python 2.4 installed, using Cheetah 2.4.3. I cannot for the life of me get Cheetah to…
purecharger
  • 1,215
  • 2
  • 15
  • 33
3
votes
1 answer

Automatic compilation of parent templates

I am trying to setup dynamic compilation of Cheetah templates, useful for development (so I don't have to recompile them with cheetah compile after each change). Seems like Cheetah.Template.Template is right API for that, but it simply doesn't…
Roman Bodnarchuk
  • 26,469
  • 11
  • 56
  • 73
3
votes
1 answer

cheetah templating with flask

I can't seem to find any information about using the cheetah templating engine with flask. Can anyone point me to something that google can't find, or show me how to use cheetah templates in a simple flask app? Thanks very much in advance.
Hoopes
  • 3,077
  • 4
  • 31
  • 50
3
votes
1 answer

Python Cheetah - Specify name/value pairs for templating

I am trying to template-ize my Apache httpd configuration for deployment to different environments and I would like to use the Python language Cheetah application to do so. However, I am having difficulty with the command line cheetah program and I…
purecharger
  • 1,215
  • 2
  • 15
  • 33
3
votes
2 answers

AppEngine database model has has_key() method but is not iterable?

I am getting: argument of type 'Lantern' is not iterable in one of the template engine files (Cheetah). As you can guess the obj is a Lantern (see below). NameWrapper.py: if hasattr(obj, 'has_key') and key in obj: This is a simplified version of my…
kev
  • 7,033
  • 12
  • 46
  • 83
3
votes
0 answers

Is there something like Qt Designer for the web on Linux?

I'm very used to using Qt Designer to design GUIs, and I would like to be able to use something similar on a Python project I'm working on that I'd like to create a web interface for, but I find that a similar tool seems to be no where to be…
supercheetah
  • 2,964
  • 4
  • 21
  • 35
2
votes
0 answers

Can I use linting/fixing tools on a Cheetah template?

I’m trying to use prettier to fix Javascript/HTML code formatting. Unfortunately the final Javascript/HTML is generated from a Cheetah template, so there are many lines that start with # characters. Those are throwing errors that prevent Prettier…
user2597451
  • 1,783
  • 2
  • 10
  • 7
2
votes
1 answer

cheetah template importing functions

So I am having some trouble trying to import functions and run them inside my cheetah templates. So I have one file that lives at /docroot/tmpl/base.html and then another file that is /docroot/tmpl/comments.html inside of comments I have something…
BillPull
  • 8,335
  • 15
  • 54
  • 93
2
votes
2 answers

Cheetah #include doesn't place #def within scope

When I include a file using #include (without raw) it parses the content correctly, but the #def which I want to access within the original file doesn't exist & an error is thrown. Base Template: #def sayHello($name) hello $name #end…
smokedice
  • 670
  • 2
  • 8
  • 21
2
votes
3 answers

Is there a way to get a list of all placeholders in a cheetah template

For example, if I have a template such as "SELECT * FROM myOrders WHERE order_id = ${orderId} and order_date = ${orderDate}" I would like to get a list of all placeholders in that template, i.e. ['orderId', 'orderDate']
victtim
  • 620
  • 4
  • 15
2
votes
2 answers

Passing data from the cherrypy server-side to javascript client-side

Big picture question. I've got a cherrypy server running with all the shopping cart methods for my e-commerce site written in python. I'm working with jquery on the front end. POSTing to my python methods is easy in javascript, but not passing data…
colinmarc
  • 21
  • 2
2
votes
2 answers

Cheetah with Cherrypy: how to load base templates, and do so automatically on change during development

I am working on a cherrypy+cheetah app and would like to improve the development experience. I have everything working when I manually compile templates beforehand. (Update: This is how things work for production: precompile, don't ship *.tmpl and…
Heikki Toivonen
  • 30,121
  • 10
  • 40
  • 43
1
2 3 4 5