cheetah

How do we setup Cheetah so it runs with all templates in the templates directory and all code in the .. directory

How do we setup Cheetah so it runs with all templates in the templates directory and all code in the .. directory in code.py production=True if not production: try:web.render('mafbase.tmpl', None, True, 'mafbase') except:pass else: from templates import mafbase in templates/mafbase.tmpl and templates/mafbase.py try:web.r...

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 doing anything other than using very simple variable/attribute/methods in the Cheetah templat...

Is Python only for building backends when you need to write SQL by hand?

I am completing my first database project which aims to build a simple discussion site. The answers which I got at Superuser suggests me that Python is difficult to use in building a database webapp without any other tools. Which other tools would you use? ...

generating javascript string in python

i have string stored in python variables, and i am outputting a html that contains javascript, and the i need to create javascript variables. for ex, in python title = "What's your name?" i use Cheetah to generate the html. Cheetah code: var title = '$title'; how do i escape this correctly so that a correct javascript variable is ...

Cheetah pre-compiled template usage quesion

For performance reason as suggested here, I am studying how to used the pr-compiled template. I edit hello.tmpl in template directory as #attr title = "This is my Template" \${title} Hello \${who}! then issued cheetah-compile.exe .\hello.tmpl and get the hello.py In another python file runner.p...

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 load templates as regular python modules.) However, during development I'd rather just loa...

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 the other way. I can send it back with JSON, but not always conveniently. It seems like ...

Un/bound methods in Cheetah

Is there a way to declare static methods in cheetah? IE snippets.tmpl #def address($address, $title) <div class="address"> <b>$title</h1></b> #if $address.title $address.title <br/> #end if $address.line1 <br/> #if $address.line2 $address.line2 <br/> #end if $address.town, $address.state $address.zipcode </div> #end def .... other sn...

How can I properly use multidimensional dictionaries in Cheetah for Python?

I have the following dictionary: {0: {'Shortname': 'cabling', 'Name': 'CAT5 Cabling', 'MSRP': '$45.00'}, 1: {'Shortname': 'antenna', 'Name': 'Radio Antenna', 'MSRP': '$35.00'}} And using Cheetah, the following section of template: #for $item in $items <tr> <td>$item.Name</td> <td>$item.MSRP</td> </tr> #end for When I run the code, ...

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 believe its a combination of my misunderstanding Cheetah along with a lack of documentatio...

Trouble with easy_install cheetah on WIndows Xp

I have installed PyQT from this URL: http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-Py2.6-gpl-4.7.7-1.exe I have Python 2.6 installed. My OS is Windows XP SP3. I entered this into cmd.exe: easy_install cheetah This is the output: C:\Documents and Settings\All Users>easy_install cheetah Searching for cheetah Best ...

cheetah in appengine

hi, i have decided to ditch django in favour of cheetah and something strange has happened. on the appengine server it appears to work fine (simple demo), but on my local appengine host it complains of File "/Users/sharif/Projects/myProject/main.py", line 7, in <module> from Cheetah.Template import Template ImportError: No module name...