473,661 Members | 2,453 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

silent processing with python+modpytho n+cheetah

Hi,

I have been working for some time developing web pages using python,
modpython, cheetah.
I find that this method has come inherent difficulties in it like if
we want to generate a single page we have to write two separate files
( py & tmpl).
Is there any other better way of doing things.?

Also if we want to have partial processing of the pages, i.e, the
value one chooses for a particular field determines the value to be
entered for another field in the same page, how can it be done?

Thanks,
Sai krishna.
Oct 21 '06 #1
2 1369
Sai Krishna M a écrit :
Hi,

I have been working for some time developing web pages using python,
modpython, cheetah.
I find that this method has come inherent difficulties in it like if
we want to generate a single page we have to write two separate files
( py & tmpl).
Is there any other better way of doing things.?
If you need to write specific python module and template for each and
any page of your site/app, it may be time to google for "content
management system" and "model view controller".
Also if we want to have partial processing of the pages, i.e, the
value one chooses for a particular field determines the value to be
entered for another field in the same page, how can it be done?
Stop thinking in terms of "page", and you'll be on the way. Or switch to
Pylons:
http://www.pylonshq.com
Oct 21 '06 #2

Sai Krishna M wrote:
Hi,

I have been working for some time developing web pages using python,
modpython, cheetah.
I find that this method has come inherent difficulties in it like if
we want to generate a single page we have to write two separate files
( py & tmpl).
Is there any other better way of doing things.?
It sounds like you are actually using mod_python.publ isher and hand
crafting the code to render the template file in each instance. Using
mod_python.publ isher is not the same as using basic mod_python handlers
directly. If you were using basic mod_python handlers directly, you
certainly could write your own dispatcher which encapsulates in one
place the code needed to render a Cheetah template file, thereby
avoiding the need to create .py file corresponding to every Cheetah
template file.
Also if we want to have partial processing of the pages, i.e, the
value one chooses for a particular field determines the value to be
entered for another field in the same page, how can it be done?
That sounds like an internal issue of how you use Cheetah templates
itself. Cheetah templates have flow control abilities, blocks etc such
that one can control what parts of a page are actually used.

Since mod_python inherently means you start out working at a low level,
and that you don't perhaps fully appreciate the different levels of
functionality in mod_python and how to use them, you are possibly
better off using a high level framework such as Django or TurboGears
where someone else has done all the hard work of making it simple to
use.

Graham

Oct 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
4603
by: Erik Johnson | last post by:
This is somewhat a NEWBIE question... My company maintains a small RDBS driven website. We currently generate HTML using PHP. I've hacked a bit in Python, and generally think it is a rather cool language. I've done Perl and like it, there are a few features of PHP I like but overall am not too excited about it. I have found PHP's strtotime() function to be quite flexible and handy and we make liberal use of it. I have not yet really...
2
8879
by: mir nazim | last post by:
i m currently using PHP with Apache (a.k.a 'mod_php') for my web development work. i came to know that python can also be used to do web programming using 'mod_python' for Apache. i wanted to know the difference between th two 'mod_php' and 'mod_python' in terms of: 1. speed of execution. 2. productivity 3. maintainance (i know python is most productive and maintainable language in the world, but is it same for web programming with...
3
1798
by: Michael | last post by:
Hey everyone, Is it possible to automatically insert headers/footers using mod_python? I will be not be using PSP's, so I cannot use the PSP/include solution. Furthermore, the header will be dynamic; it won't be a static HTML page. In short, I've been looking for a page layout facility using mod_python.
12
1399
by: pistacchio | last post by:
hi! i'm a php user and a python programmer. i'd love to use python for my server side needs but i can't seem to find what i'm looking for. for most of my php work i use mysql and tinyButStrong (http://www.tinybutstrong.com) which is a very lightweight template engine that offers powerful functionalities. you insert TBS tags in web pages like: <div align="center" class="title-page" </div> and it replaces with the value of global...
0
8758
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7364
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4346
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1743
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.