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 594367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:56:44+00:00 2026-05-13T15:56:44+00:00

Has anyone tried using ZPT in Google App Engine? If yes, please let me

  • 0

Has anyone tried using ZPT in Google App Engine? If yes, please let me know how. Thanks in advance.

EDIT:

An example at http://gae-zpt.appspot.com/ by DisplacedAussie https://stackoverflow.com/users/2962/displacedaussie

It can be downloaded from http://github.com/displacedaussie/gae-zpt

I can now happily run at: http://blogthere.appspot.com/

  • 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-13T15:56:45+00:00Added an answer on May 13, 2026 at 3:56 pm

    First of all I’ll explain how to use ZPT in a normal project. From there I’ll show you specifically how to get it working with Google App Engine.

    Install zope.pagetemplate

    # easy_install zope.pagetemplate
    

    In your python view code, add something like this

    from zope.pagetemplate.pagetemplatefile import PageTemplateFile
    
    my_pt = PageTemplateFile('mytemplate.pt') 
    context = {'row': ['apple', 'banana', 'carrot'], 'foo':'bar'}
    print my_pt.pt_render(namespace=context)
    

    In your template (mytemplate.pt)

    <html> 
      <body> 
        <h1>Hello World</h1>
        <div tal:condition="python:foo == 'bar'"> 
          <ul> 
            <li tal:repeat="item rows" tal:content="item" /> 
          </ul> 
        </div>
      </body> 
    </html>
    

    What this basically means is that you’ll need to do the following:

    • Make sure you can install zope.pagetemplate
    • Create a .pt file
    • In your view code, name a template and then render it with the given context

    Google App Engine

    In GAE you’re able to use (almost) any code you like, but you have to provide it with your application. To make use of ZPT you’ll need to get copies of the zope.pagetemplate package and anything it depends on. I can tell you that when you do an # easy_install zope.pagetemplate you end up with the following packages:

    • zope.pagetemplate
    • zope.i18nmessageid
    • zope.interface
    • zope.tal
    • zope.tales

    It’s highly likely that you can trim these down and remove the code that you don’t actually need, but I’ll leave this as an exercise for you.

    Once you have a copy of each of the above packages, put the code from each package into a “zope” directory that you’ll be able to include with your GAE application. This will allow you to import everything the standard way.

    Assuming you’ve got to this point, the next step is to create the template as above, put the view code into the appropriate RequestHandler, and then write the rendered output at the end of each request.

    I’ve created a basic GAE application that does this and you can download it from GitHub.

    For any existing (or new) projects you have, just take the ‘zope’ directory from the example application and use it as described above.

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

Sidebar

Related Questions

No related questions found

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.