473,848 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python tools for managing static websites?

Are there Python tools to help webmasters manage static websites?

I'm talking about regenerating an entire static website - all the HTML
files in their appropriate directories and sub-directories. Each page
has some fixed parts (navigation menu, header, footer) and some
changing parts (body content, though in specific cases the normally
fixed parts might change as well). The tool should help to keep site
editing DRY every piece of data, including the recurring parts, should
exist only once.

The above should be doable with any decent templating tool, such as
those forming part of most CMSes and full-stack web-frameworks.
Normally I might have just resorted to a CMS/web-framework, running
locally on the webmaster's station, with the only addition being a
mechanism for generating all pages composing the site and saving them
as files.

But such a solution might not be enough, as the system I'm looking for
must be able to control the physical traits of the website as a
collection of files - e.g., creation and distribution of files among
several physical directories and subdirectories.

Any advice would be appreciated,
-Chris
Oct 31 '06 #1
9 2271
Firedrop2 is a content management system for static web sites. I have
used it to manage www.awaretek.com for 3-4 yearts now. it is perfect
for what you descibe. You can mkae a change in format and apply it to
all pages in a flash. It is very stable, and it is easy to use. It is
written in Python, actively maintained by Michael foord, and you can
easi;ly extend it with Python plugins. Open source, free as in beer,
etc.

http://www.voidspace.org.uk/python/firedrop2/

Ron Stephens

Oct 31 '06 #2

Chris Pearl wrote:
Are there Python tools to help webmasters manage static websites?
rest2web is a tool designed specifically for creating and managing
static websites. It uses templates and has built-in tools to aid with
creating side bars and navigation trails.

It allows you to store your pages in reStructured Text or HTML format.
It gives you full control of the 'shape' (in terms of directories) of
both your source files and target files (the html it generates).

http://www.voidspace.org.uk/python/rest2web/

Fuzzyman

Oct 31 '06 #3
jkn
Hi there

I used cheetah (cheetahtemplat e) and a makefile for something similar
;-). It worked pretty well for me. I only have a dozen or so pages
though.

I'm currently converting this to Jinja, which is a similar templating
system compatible with Django. I plan to later migrate to dynamic pages
under Django.

http://www.cheetahtemplate.org
http://wsgiarea.pocoo.org/jinja/

HTH
Jon N

Oct 31 '06 #4
Chris Pearl wrote:
Are there Python tools to help webmasters manage static websites?

I'm talking about regenerating an entire static website - all the HTML
files in their appropriate directories and sub-directories. Each page
has some fixed parts (navigation menu, header, footer) and some
changing parts (body content, though in specific cases the normally
fixed parts might change as well). The tool should help to keep site
editing DRY every piece of data, including the recurring parts, should
exist only once.

The above should be doable with any decent templating tool, such as
those forming part of most CMSes and full-stack web-frameworks.
Normally I might have just resorted to a CMS/web-framework, running
locally on the webmaster's station, with the only addition being a
mechanism for generating all pages composing the site and saving them
as files.

But such a solution might not be enough, as the system I'm looking for
must be able to control the physical traits of the website as a
collection of files - e.g., creation and distribution of files among
several physical directories and subdirectories.
Chris,

If you don't mind me pimping my own static website generator, you might
find HRL useful:

http://www.aerojockey.com/software/hrl

On one hand, it's like an ordinary templating engine in that you can
define macros and variables and such, and stick them into documents.
For example, define a sidebar macro in the file macro.hri:

<macro name="sidebar">
<ul>
<li>First menu entry</li>
<li>Second menu entry</li>
<li>Thrid menu entry</li>
</ul>
</macro>

This creates a new "sidebar" tag that expands to the macro definition.
You can use this macro in your main document file:

<include file="macro.hri ">
<sidebar>

However, HRL is much more powerful than a simple templating system,
because it can embed Python code to be run during page generation.
Here's a very simple example:

<python>
import time
hrl.doc.write(" Page last generated on %s" %
time.asctime(ti me.localtime()) )
</python>

Thus, unlike most templating engines, HRL can adapt very well to
unusual situations. You can embed the Python "scriptlet" into macro
definitions to create very powerful macros. For instance, you could
write a sidebar macro to automatically disable the link to the current
page--impossible with a simple text-substitution engine. Even more
powerful uses are possible. You could write a macro that inserts
information from a database into the page (which sounds kind of like
what you mentioned).

On the downside, it's not exactly hip to the latest web trends. It
uses sgmllib for input, bleagh. The list of HTML tags it knows about
is vintage 1998. (One of my design goals was freedom to be sloppy with
closing tags. HRL keeps track of and automatically closes tags when
appropriate, but it doesn't know about tags like embed.) And it's not
any sort of enterprise-quality content management. It's just a
templating engine with power.
Carl Banks

Oct 31 '06 #5
Thanks to everyone who have contributed to this thread. Several of the
posted suggestions definitely warrant a closer look. I'm going to
review those and publish my final choice - including the reasons for
it - if anyone's interested.

-Chris
Nov 2 '06 #6
"Chris Pearl" <ch********@gma il.comwrites:
Thanks to everyone who have contributed to this thread. Several of the
posted suggestions definitely warrant a closer look. I'm going to
review those and publish my final choice - including the reasons for
it - if anyone's interested.
Yes please.

--
\ "The opposite of a correct statement is a false statement. But |
`\ the opposite of a profound truth may well be another profound |
_o__) truth." -- Niels Bohr |
Ben Finney

Nov 2 '06 #7
I haven't seen mention of HTMLgen, another python package. Check it
out at:

http://starship.python.net/crew/frie...html/main.html

Glenn

Nov 2 '06 #8

Glenn Hutchings wrote:
I haven't seen mention of HTMLgen, another python package. Check it
out at:

http://starship.python.net/crew/frie...html/main.html

Glenn
For whatever reason, the Starship (hence that link) has been down for a
while. :-(

But I do agree that HTMLgen is worthy of consideration (I use it
myself).

Nov 2 '06 #9
"Chris Pearl" <ch********@gma il.comwrote:
Are there Python tools to help webmasters manage static websites?

I'm talking about regenerating an entire static website - all the HTML
files in their appropriate directories and sub-directories. Each page
has some fixed parts (navigation menu, header, footer) and some
changing parts (body content, though in specific cases the normally
fixed parts might change as well). The tool should help to keep site
editing DRY every piece of data, including the recurring parts, should
exist only once.

Tahchee <http://www.ivy.fr/tahchee>

SUMMARY = "Automated static and dynamic web site creation tool"
DESCRIPTION = """\
Tahchee is a tool for developers and Web designers that makes it possible to
easily build a static Web site using the Cheetah template system. It is used to
fill in the gap between bare template and macro processing system and dynamic
template-based Web sites. It acts both as a build system (ŗ la "make") as well
as an extension to the Cheetah template that makes it really easy to build small
to medium-sized sites. It is ideal for writing open source project or small
company Web sites.\
"""

Florian
--
<http://www.florian-diesch.de/>
Nov 4 '06 #10

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

Similar topics

0
1725
by: cognite | last post by:
This venue would surely appreciate the cool stuff being done in python on bioinformatics and python's tools for info parsing and extraction (like fulltext indexing, xml tools, parser builders, graphic display, realtime simulation and communities tools like pygame and ...) It's in San Diego February 9-12, 2004. "Session presentations are 45 or 90 minutes long, and tutorials are either a half-day (3 hours) or a full day (6 hours)."
34
3670
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...
21
4845
by: dub | last post by:
Hello web folks... I've been desigining web pages for 13 years using my trusty text editor (UltraEdit) and in depth knowledge of HTML. I'm truly a text editor ninja at this point. I am frequently using regular expressions to search and replace in multiple files. I also use many different copy buffers and know all the keyboard shortcuts like the back of my hand. The point is... it's comfortable. Unfortunately, it's become just too...
10
9933
by: TokiDoki | last post by:
Hello there, I have been programming python for a little while, now. But as I am beginning to do more complex stuff, I am running into small organization problems. It is possible that what I want to obtain is not possible, but I would like the advice of more experienced python programmers. I am writing a relatively complex program in python that has now around 40 files.
2
4461
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c */ #include <time.h>
53
4412
by: Michael Tobis | last post by:
Someone asked me to write a brief essay regarding the value-add proposition for Python in the Fortran community. Slightly modified to remove a few climatology-related specifics, here it is. I would welcome comments and corrections, and would be happy to contribute some version of this to the Python website if it is of interest. ===
62
2941
by: estherschindler | last post by:
This is part of a series examining the strengths and weaknesses of various scripting languages, with particular attention to enterprise (read: big company) use. You Used Python to Write WHAT? Python is a powerful, easy-to-use scripting language suitable for use in the enterprise, although it is not right for absolutely every use. Python expert Martin Aspeli identifies when Python is the right choice, and when another language might be a...
0
9893
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9737
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10663
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
10722
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
7069
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5734
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
5919
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4544
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
4136
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.