Pybloxsom out, QP Journal in
In the summer I was writing a series of articles - a web application diary of sorts - illustrating web development with Python and the QP web framework. After several thousand words and seven installments, the series paused back in July.
As I get my obligation stack beaten back to merely mountainous I plan on continuing with the series and indeed have plans to re-factor the whole lot and make it available in a subversion repository, step by step. The latter idea is not mine; I ran across another such article series in the Pythonosphere which had used subversion to good purpose.
To help encourage me to write more, I jumped ahead and put a slightly enhanced version of the Journal application on-line as of the last couple of days; all the old Pyblosxom hosted articles have been imported.
As contemplated back in June, I did decide to embrace breakage - all the old content has shiny new URL's, although a simple url_mapping dictionary and a 301 Moved Permanently redirect have more or less looked after avoiding 404 errors all over the place. Pretty easy to do, this is part of my SiteDirectory class:
def _q_traverse(self, path):
"""
First check to see if request is hunting for an old URL,
redirect if so.
"""
uri = get_request().get_path_query()
dest = get_publisher().get_root()['url_mapping'].get(uri, None)
if dest:
return redirect(dest, permanent=True)
else:
return JournalDirectory._q_traverse(self, path)
Incidentally my url_mapping has almost 1700 different combinations pointing to 478 content items and various query strings and other site features. Most of the values in the mapping were created during the import of the old data; apparently I was less than consistent in the way I pushed out Pyblosxom over the years I used it. Now at least there is one URI for each resource and no more.
Back soon with part eight of the series.