I had some time this weekend and started cleaning up the non core plugins I am using on this website. The Folksonomy plugin is one of my most favourite ones. It not only creates the tag-links and tagcloud on this site it also provides the related story links at the bottom of each article.

The only small nitpick I had was that it had to parse every post for every request. With the small number of articles on this site, this is not a problem but I wanted to fix it anyway. Utilizing the new command-line functionality of pyblosxom 1.5 I created a small cache file creation command that creates the majority of the data. During this process I also decided to put this plugin up on GitHub so other people can use it.

Please note the initial author of this plug-in is Timothy Fanelli he did the majority of the work. I just made it work with pyblosxom 1.5 and added the caching functionality.

So I spent some quality time this weekend and "backported" the site to the current pyblosxom HEAD. I managed to get all my old plugins working as well which is a big plus. The next step is a new site design since I am tired of the current one. Let's see how this is coming together.

So eventually I got sick of all the comment spam I got recently. That's why I switched the comment system to DISQUS. While the switch was easy I did not take my time to migrate the existing comments.

Update: So this was a short foray into the world of DISQUS. I switched back to the pyblosxom internal comment system. While looking nice, I think it is overkill for this site.

Long time no pyblosxom related info, I know.

Pyblosxom:

Will more or less asked me to join the pyblosxom development team. Well it was more or like "Hey, what's your sourceforge username I'll add you as developer". My first task is to take a look at the setuptools related config and update it.

Site:

As for the site news. Well the link to scenemusic is no longer there but you can now see, what I was listening to recently. Kudos to last.fm to make this possible. The way I did it was pretty simple in the end, a more detailed description will follow.

Ok, that's it for now, I hope you enjoyed the show and see you around.

Since I always hated my CGI set-up here I took the plunge and tried to get pyblosxom running with WSGI. This is more or less a short HOWTO that shows how I did it. I am not sure if this is the best way to do it but it works for me.

Requirements:

  • WSGI

    This comes bundled with the latest python releases, if yours is older the easiest solution is to use easy_install. Just download and install it if you haven't done yet and then call

easy_install wsgiref

Setup:

Put mp_wsgi_handler.py, wsgi_app.py and your config.py in the same directory. Follow the directions in the wsgi_app.py file and put the <Location> entries in your httpd.conf file. Here it is once more. Do not forget to change PythonPath so all the required files are found.

<Location /weblog>
      PythonDebug Off
      SetHandler python-program
      # set PythonPath to the folders containing the files.
      PythonPath "['/path/to/mp_wsgi_handler', '/path/to/wsgi_app']+sys.path"
      PythonHandler mp_wsgi_handler::wsgi_handler
      # This should be the same as the Location above
      PythonOption ApplicationPath /weblog
      PythonOption application wsgi_app::application
</Location>

That's it you can now access your blog on your server via /weblog. But what if you do not want to use http://<servername>/weblog everytime?

I wanted to do exactly that. My first try was to change

<Location /weblog>

to

<Location />

This more or less worked, but since mod_python now took all requests I was not able to serve static files. I reverted the change and added some .htaccess entries instead.

.htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(?!weblog)(.*)$ /weblog/$1 [QSA,L]

So what are these entries doing?

If the request is not an existing file or directory

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d [OR]

OR it is the base url

RewriteCond %{REQUEST_URI} ^/$

rewrite it to /weblog but only if it isn't already /weblog

RewriteRule ^(?!weblog)(.*)$ /weblog/$1 [QSA,L]

Difficult yes, working yes, solveable in a better way maybe but I do not know how. :)

If you have any questions or comments do not hesitate to ask me.

So I did what a had to do and revived my 3 year old pyblosxom layout. After some fiddling around with some div's I think it is ready to be looked at. What do you think? This is the first day of my holidays so expect more to come, or not.

First post with the new/old blog system. I used pyblosxom before, then took a break, switched to wordpress and then once more came back to pyblosxom. There are several reasons for it.

  1. Ease of use

    Although the setup seems more complicated, pyblosxom is easier to use. All you have to do is to create text files. Wordpress on the other hand, while easy to set-up, is operated via a web interface. Yes of course you can use one of the available blog editors to create new entries or even use the mail interface, but then it gets more complicated.

  2. Pythonic flavour

    So you edit you posts with a nice editor upload it to your blog/database and are happy with it. If you like it this way go on and use other blogging tools. Pyblosxom on the other hand is very close to the first blogging system widely used blosxom with the difference that it is written in python instead of perl. If you want to use blosxom instead of pyblosxom go on and do it I won't stop you. The thing is, blogging started as a fast way to get your ideas/thoughts/ramblings postet with out much thinking about the layout. We should really go back to the basics and do this.

  3. Funkiness

    Databases and PhP are really great fun but what nothing beats playing with Python.

To be continued......