Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7640207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:36:46+00:00 2026-05-31T08:36:46+00:00

I am trying to setup dynamic compilation of Cheetah templates, useful for development (so

  • 0

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 handle parent templates.

So if I have:

 -- __init__.py
 -- index.tmpl:
    #extends layout.A
 -- layout/
          -- __init__.py
          -- A.tmpl:
          #echo 'Hello!'

If I run Python in root directory, I’d get the next:

>>> from Cheetah.Template import Template; t = Template(file='index.tmpl')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.6/site-packages/Cheetah-2.4.3-py2.6-freebsd-7-amd64.egg/Cheetah/Template.py", line 1259, in __init__
    self._compile(source, file, compilerSettings=compilerSettings)
  ...
  ImportError: No module named A

If I compile A.tmpl with cheetah compile, error disappears, but changes in template doesn’t affect result of index.tmpl compilation:

$ cat layout/A.tmpl
#echo 'Hello, world!'

$ python
>>> from Cheetah.Template import Template; t = Template(file='index.tmpl')
>>> str(t)
'Hello!'

Should I recompile all parent templates by myself (e.g. like Aquarium framework does)?

Cheetah version 2.4.

Any tips about Django1.3\Cheetah integration are also appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:36:48+00:00Added an answer on May 31, 2026 at 8:36 am

    Some where early in your process startup, include the following two lines:

    import Cheetah.ImportHooks 
    Cheetah.ImportHooks.install() 
    

    I believe this will give you the behavior you are looking for.

    This is not documented in the main docs, but Tavis Rudd suggested this in response to a similar question on the Cheetah mailing list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When trying to run an Eclipse Dynamic Web Project under a Tomcat setup using
Trying to setup a CodeIgniter based project for local development (LAMP stack), and once
I am trying to setup generic Knockout templates that can be toggled between edit
Hello I have a Dynamic DataTable Created at runtime. The Setup is like so
I am trying to take favicons and add them to a dynamic image that
Setup I have a graph library where I am trying to decompose things as
I have a UITableview setup in my iphone app. At the moment, each row
Been playing with nginx for about an hour trying to setup mass dynamic virtual
Trying to setup some validation on the add to cart button for the dropdown
Trying to setup and get going with the RestKit library for a cocoa project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.