Serve PageTemplates with Medusa
File ID: 66691
Serve PageTemplates with Medusa
Serve PageTemplates with Medusa Description
Description: This recipe combines the delicious PageTemplates package with the flavorful Medusa package to serve up rendered PageTemplates from the file system.
Why not just use Zope you say? As far as I know, the current Zope release isn't an option with Python 2.2 code. The project for which this recipe was devised requires Python 2.2.
Ingredients you'll need:
Python 2.2. If you're using 2.1, try Zope instead, as it does everything this recipe can do plus a whole lot more.
ExtensionClass and friends. There is more than one way to get ExtensionClass installed, but the method I've used successfully is to install StandaloneZODB. That package is available here: http://www.zope.org/Products/StandaloneZODB
PageTemplates, TAL, and ZTUtils packages. These are available in the Zope source releases but must be installed manually. Again, there's more than one way to make these packages available in your system. The method I've used is to copy the package directories from the Zope source archive into the Python lib/site-packages/ directory. The Zope source is available from this link: http://www.zope.org/Products
Medusa. I used Medusa 0.5.2 to develop this recipe, but you may have an equally pleasant experience with other versions. You can get Medusa here: http://oedipus.sourceforge.net/medusa/
A Medusa startup script. As with all Medusa handlers, you must explicitly construct a PageTemplates handler and associate it with an HTTP server. You can modify a copy of the sample startup script included with Medusa or create your own.
Some PageTemplates. The code below reads PageTemplates markup from files stored in your file system. Give your markup files a ".pt" or ".ptx" extension, and the handler will try to render them as PageTemplates before returning their markup.
Once you have all these items in place, modify your Medusa start up script:
Save the code below as "pagetemplate_handler.py", and bring it into your script: import pagetemplate_handler
Construct a pagetemplate_handler.pagetemplate_handler, pagetemplate_handler.pagetemplate_xml_handler, or both. These types need a filesystem object, just like the default_handler.
Associate your pagetemplate_handler with your HTTP server.
|More Similar Code|
MobilePress is a WordPress plugin that will render your WordPress blog on mobile handsets, with the ability to use customized themes. Built into MobilePress is the ability to track your mobile sites analytics and serve ads with Aduity.com.
Integration with Aduity.com enables you to serve ads from some of the biggest mobile ad networks such as Admob, Quattro Wireless, Buzzcity and InMobi. You can also serve you own managed ads. You...
This section demonstrates remote method calls between two
machines (or processes) using the XML-RPC protocol. A complete
example of working client/server code is provided.
Now a day's wedding invitation design has become really good business, you can earn brilliant money by launching a site with our wedding design script. We also provide technical support through out installation.
The Banner Serve is a simple banner manager with which you will be able to place your banners on remote sites. With this script you can get complete statistics regarding each user and each banner and also it collects information for each banner...
With the inClick Ad Server, you can serve text ads on your site in a pay-per-click bid-for-placement environment. Beyond just a simple ad server, inClick allows you to serve ads based on keywords and content, unlimited zones, and more. Become an...
Newsletter Mx is bundled with Html Editor for Composing Newsletters Online (insert tables, Form elements, Add images, Word Spell Checker and support for 22+ languages and lot more. If the Editor does not serve your purposes then Create your own...
AntiSpam's primary purpose is to serve as a programming exercise to test an ostensibly primitive method of dealing with unwanted email (SPAM).
The current release works with Outlook Express 6, but future versions will include...
The files contained in this zip file
serve as an introduction to using RTDX technology from Texas Instruments with Simulink for the purpose of verifying that that your Simulink simulation is running the same way as your DSP implementation....
phpMyWebServices is a framework that can serve dotNET-like Web services coded in PHP, so it works on all apache/php servers (MySQL not required).
With it, you can easy host any webservice on the most of free hosting services !!!
|User Review for Serve PageTemplates with Medusa
All files and free downloads are copyright of their respective owners. We do not provide any hacked, cracked, illegal, pirated version of scripts, codes, components downloads. All files are downloaded from the publishers website, our file servers or download mirrors. Always Virus check files downloaded from the web specially zip, rar, exe, trial, full versions etc. Download links from rapidshare, depositfiles, megaupload etc not published.