On Sun, 2006-08-06 at 11:26 +0200, Maciej Bliziński wrote:
> Hello Djangoers,
> 
> I've created a website some time ago. It stores data in XML and uses
> XSLT transformation to generate static HTML files. Further development
> of the website is more and more painful, to add a new feature would be
> as much time consuming as moving the whole thing to Django.
> 
> There's only one thing missing. The website has to be in form of static
> HTML files.
> 
> I guess it would involve running a Python script that would traverse all
> the possible views with all the possible arguments and store the results
> on the disk.

Is it easy to determine the set of "all possible arguments"? If it
isn't, you might want to just seed the URL set and follow all the links
to other pages on the site. With "clever" initial URLs and a sensible
site navigation, you should be able to finish up by hitting everything.

I couldn't tell you all the URLs on my weblog. But I do know that there
are links to the archive pages that will eventually retrieve every
article. So providing I start at '/blog/' and follow all links, I'll get
them all.

Your case may be easier, but it's worth thinking about.

> Did anybody tried this before? If yes, how? If not, what technique would
> you suggest?

When I'm changing code underneath my website that is not meant to change
the appearance at all, I tend to use a poor man's regression test like
that ("wget --mirror ..." all the pages and then use md5sum to check for
changes against a previous copy). Yeah, it's lame; but it takes three
seconds to run and gets the job done.

The one corner case you might want to work around for generating static
files like this is where you have multiple paths to the same file (e.g.
if a URL changed and you are using a redirect or if there is a shortcut
to a "front page" article, say). It's pretty easy to fix if you care,
though. After grabbing static copies of all the pages, run md5sum or
sha1sum over the results, sort and look for duplicates. Change the
duplicates to symlinks.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to