Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #40499
| Date | 2013-03-04 20:56 -0700 |
|---|---|
| From | Michael Torrie <torriem@gmail.com> |
| Subject | Re: Embedding a for inside an html template for substitution |
| References | <1a5a68d8-a97e-4069-a860-c7737dd5a503@googlegroups.com> <mailman.2845.1362412789.2939.python-list@python.org> <6ce88927-ed2f-4045-a23c-033f18cb332a@googlegroups.com> <CAM1e3vqTujmRtYC1ckjCMt_3gWtBcSOOu==+bB69z5YUdGnMPw@mail.gmail.com> <5134FEB5.4090104@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2864.1362455785.2939.python-list@python.org> (permalink) |
On 03/04/2013 01:06 PM, Ferrous Cranus wrote: > What do you advise me to do? > Generate html via python code like print '''stuf......''' or use an > html templating system? > Up until now i was using the first method and i though it would be a > nice idea to seperate design from code. > > But please also provide me a simple example of 'files.html' and > 'files.py' so i can understand how does the templating system you > mentioned work. Was it Django?! Just generating html code is simple, but it does become a bit messy over time. Check out that link in my previous e-mail to a list of python templating engines. Choose one and try it. No I cannot provide any example code. I haven't used any of these systems; I'm just googling for you. Most of them come with examples anyway. Check out, among others: http://www.cheetahtemplate.org/docs/users_guide_html/ And actually this one uses cheetah to do static pages (not a full-blown web app): http://www.ivy.fr/tahchee/ I do recommend you at least take a look at Django. It may be overkill for your needs. It does contain a templating engine, but it also contains a whole lot more useful things for doing web-based applications. Here's the link in case you missed it: http://wiki.python.org/moin/Templating
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Embedding a for inside an html template for substitution Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-03-04 07:14 -0800
Re: Embedding a for inside an html template for substitution Michael Torrie <torriem@gmail.com> - 2013-03-04 08:59 -0700
Re: Embedding a for inside an html template for substitution Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-03-04 09:22 -0800
Re: Embedding a for inside an html template for substitution Michael Torrie <torriem@gmail.com> - 2013-03-04 20:56 -0700
Re: Embedding a for inside an html template for substitution Roland Koebler <r.koebler@yahoo.de> - 2013-03-05 18:16 +0100
Re: Embedding a for inside an html template for substitution Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-03-04 09:22 -0800
Re: Embedding a for inside an html template for substitution nagia.retsina@gmail.com - 2013-03-04 23:46 -0800
csiph-web