Google Groups Home
Help | Sign in
html in cherrypy code
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  15 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
James  
View profile
 More options Jun 24, 7:58 pm
From: James <j...@nc.rr.com>
Date: Tue, 24 Jun 2008 19:58:23 -0400
Local: Tues, Jun 24 2008 7:58 pm
Subject: html in cherrypy code
All,

I'm wondering if anyone knows of any good tutorials on the web that
describes how to properly integrate HTML in CherryPy code. As I write
my web application I obviously need to create a header and a 'body'
with HTML code. I haven't found any good documents online that
describes how to go about doing this.

Also, does anyone have any recommendations on a good 'beginner' book
for CherryPy? I'm very familiar with Python but am ramping up (slowly)
with CherryPy and could use a good read. The documentation / tutorial
on the CherryPy page was lacking a bit.

Thanks!
- james


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Abrahamsen  
View profile
 More options Jun 24, 10:31 pm
From: Eric Abrahamsen <gir...@gmail.com>
Date: Wed, 25 Jun 2008 10:31:42 +0800
Local: Tues, Jun 24 2008 10:31 pm
Subject: Re: [cherrypy-users] html in cherrypy code
There are a lot of python-based tricks you can use for outputting  
HTML, such as string formatting, or base classes that define headers  
and footers and are extended by other classes that define content, etc  
etc. But I've found that after two or three pages of this sort of  
stuff it's far easier just to learn one of the many python templating  
packages and use that. I use Jinja, because I'm accustomed to django's  
templates, but Cheetah, Genshi, Mako and Myghty and Evoque are all  
popular options. It's just a major pain to do it yourself, and the  
more you work on a nice re-usable system for outputting html, the  
closer you come to re-inventing one of the aforementioned templating  
packages :)

So far as I know, CherryPy Essentials (http://www.cherrypyessentials.com/
) is the only book out there...

Yours,
Eric

On Jun 25, 2008, at 7:58 AM, James wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Earl  
View profile
 More options Jun 24, 10:32 pm
From: Jason Earl <je...@xmission.com>
Date: Tue, 24 Jun 2008 20:32:25 -0600
Local: Tues, Jun 24 2008 10:32 pm
Subject: Re: [cherrypy-users] html in cherrypy code

I thought that Sylvain Hellegouarch's _CherryPy Essentials_ was quite
good.

http://www.packtpub.com/CherryPy/book

I especially like the chapters on web services and AJAX.  I'd worked on
projects that did some of this stuff before, but his examples showed me
lots of things that I could have done better.  If you are interested in
building websites with CherryPy and you aren't sure where to start, you
should start with _CherryPy Essentials_.

Jason


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jonathansamuel  
View profile
 More options Jun 24, 11:59 pm
From: jonathansamuel <jonathansam...@yahoo.com>
Date: Tue, 24 Jun 2008 20:59:06 -0700 (PDT)
Local: Tues, Jun 24 2008 11:59 pm
Subject: Re: html in cherrypy code
I agree that Sylvain Hellegouarch's book on CherryPy is good. His
example in  the book uses the Kid templating engine.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
arjuna  
View profile
 More options Jun 25, 2:21 am
From: arjuna <brahmafor...@gmail.com>
Date: Wed, 25 Jun 2008 11:51:05 +0530
Local: Wed, Jun 25 2008 2:21 am
Subject: Re: [cherrypy-users] Re: html in cherrypy code

I use Mako templates and it is quite easy to integrate html with python
using cherrry py. Initially there is a bit of a learning curve, however once
you get it going, it flows along nicely...If you have any specific questions
do post as I went through this learning curve as a complete newbie
myself...\
Arjuna

On 6/25/08, jonathansamuel <jonathansam...@yahoo.com> wrote:

> I agree that Sylvain Hellegouarch's book on CherryPy is good. His
> example in  the book uses the Kid templating engine.

--
Best regards,
arjuna
http://www.brahmaforces.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Earl  
View profile
 More options Jun 25, 1:07 pm
From: Jason Earl <je...@xmission.com>
Date: Wed, 25 Jun 2008 11:07:48 -0600
Local: Wed, Jun 25 2008 1:07 pm
Subject: Re: [cherrypy-users] Re: html in cherrypy code

jonathansamuel <jonathansam...@yahoo.com> writes:
> I agree that Sylvain Hellegouarch's book on CherryPy is good. His
> example in  the book uses the Kid templating engine.

The nice thing about Sylvain's book is that he shows you how easy it is
to mix and match components in CherryPy.  For example, I have quite a
bit of experience with Zope Page Templates, and I didn't really want to
learn the ins and outs of another templating language just because I got
tired of trying to fit Zope into my head.  After reading Sylvain's Kid
examples I was able to integrate SimpleTAL in a similar manner.

In fact, choosing which templating language to use is much more
difficult than integrating your choice into CherryPy.  I swear someone
creates a new templating language for Python every 14 minutes.

Jason


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Brewer  
View profile
 More options Jun 25, 3:58 pm
From: "Robert Brewer" <fuman...@aminus.org>
Date: Wed, 25 Jun 2008 12:58:23 -0700
Local: Wed, Jun 25 2008 3:58 pm
Subject: RE: [cherrypy-users] Re: html in cherrypy code

Jason Earl wrote:
> jonathansamuel <jonathansam...@yahoo.com> writes:

> > I agree that Sylvain Hellegouarch's book on CherryPy is good. His
> > example in  the book uses the Kid templating engine.

> The nice thing about Sylvain's book is that he shows you how easy it
is
> to mix and match components in CherryPy.  For example, I have quite a
> bit of experience with Zope Page Templates, and I didn't really want
to
> learn the ins and outs of another templating language just because I
> got tired of trying to fit Zope into my head.  After reading Sylvain's
> Kid examples I was able to integrate SimpleTAL in a similar manner.

Feel free to write that up on http://tools.cherrypy.org/wiki. :)

> In fact, choosing which templating language to use is much more
> difficult than integrating your choice into CherryPy.  I swear someone
> creates a new templating language for Python every 14 minutes.

Amen. And ugh.

Robert Brewer
fuman...@aminus.org


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James  
View profile
 More options Jun 25, 4:16 pm
From: James <j...@nc.rr.com>
Date: Wed, 25 Jun 2008 16:16:27 -0400
Local: Wed, Jun 25 2008 4:16 pm
Subject: Re: [cherrypy-users] Re: html in cherrypy code
Thanks for the replies, everyone.

Is there a "best" templating system? Or is it a simple balance of
complexity vs flexibility and power?

Thanks!

--
"Do not meddle in the affairs of wizards, for they are subtle and
quick to anger."
 -Tolkien

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lukasz Michalski  
View profile
 More options Jun 25, 6:47 pm
From: Lukasz Michalski <l...@zork.pl>
Date: Thu, 26 Jun 2008 00:47:18 +0200
Local: Wed, Jun 25 2008 6:47 pm
Subject: Re: [cherrypy-users] Re: html in cherrypy code
On Wednesday 25 June 2008, James wrote:

> Thanks for the replies, everyone.

> Is there a "best" templating system? Or is it a simple balance of
> complexity vs flexibility and power?

I am new to cherrypy and python in general and after a little research I
decided to use genshi. I think that the biggest impact on my decision was
that there is excellent tutorial abount cherrypy and genshi.

Regards,
Łukasz


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Roberts  
View profile
 More options Jun 25, 5:16 pm
From: Tim Roberts <t...@probo.com>
Date: Wed, 25 Jun 2008 14:16:27 -0700
Local: Wed, Jun 25 2008 5:16 pm
Subject: Re: [cherrypy-users] Re: html in cherrypy code

James wrote:
> Is there a "best" templating system? Or is it a simple balance of
> complexity vs flexibility and power?

In my not very humble opinion, the choice of a templating system is
*much* more a matter of personal preference than it is about performance
or complexity.  Seriously, unless you write a site that gets 500 hits a
minute (and darned few of us will every do that), you don't need to
think about performance.  Instead, you should try a simple project with
a bunch of them, then use the one that makes the most sense to you.

I know a lot of people like the Zope TAL scheme.  I don't.  To me, it
has always seemed excessively wordy and non-intuitive.  Now, I *know*
that the TAL fans would disagree with my assessment (no need to write
me), and that's just fine.  That's why there are so many choices.

For me, the Cheetah scheme has always seemed incredibly sensible.  
Simple, quick, flexible, with a great blend of Python and HTML.  It lets
me concentrate on making my pages look the way I want, without getting
in the way.  Again, I know that many people think that Cheetah breaks
the "separation of presentation and computation" rule too much, and
that's fine.  I will keep getting my work done with Cheetah, while they
get their work done with TAL.

--
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gerold Penz  
View profile
 More options Jun 25, 7:20 pm
From: Gerold Penz <gerold.p...@aon.at>
Date: Thu, 26 Jun 2008 01:20:15 +0200
Local: Wed, Jun 25 2008 7:20 pm
Subject: Re: [cherrypy-users] Re: html in cherrypy code
Tim Roberts schrieb:

> For me, the Cheetah scheme has always seemed incredibly sensible.  
> Simple, quick, flexible, with a great blend of Python and HTML.

Hello!

I think, Cheetah is a very good choice! Because, it's simple to use for
simple tasks. And it's mighty enough to do powerful tasks. And your
template donīt look like a brace-storm. ;-)

(german) http://halvar.at/python/cherrypy_cheetah/

Regards,
Gerold
:-)

--
________________________________________________________________________
Gerold Penz - bcom - Programmierung
     http://halvar.at | http://sw3.at | http://bcom.at
Wissen hat eine wunderbare Eigenschaft:
     Es verdoppelt sich, wenn man es teilt.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Earl  
View profile
 More options Jun 25, 9:00 pm
From: Jason Earl <je...@xmission.com>
Date: Wed, 25 Jun 2008 19:00:49 -0600
Local: Wed, Jun 25 2008 9:00 pm
Subject: Re: [cherrypy-users] Re: html in cherrypy code

I actually have a rough draft started.  I just need to finish it.  Part
of the problem is that while what I have got now is good enough for me.
It's not quite to the point where it is good enough for the rest of
y'all.

When I get to the point where my solution is as comprehensive as the
Jinja example, then I'll share :).

Jason


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.