Installing PyBlosxom with Paste

Author: PyBlosxom Development Team
Version: advanced_installation.txt 1029 2007-06-07 02:33:12Z willhelm
Copyright: This document is distributed under the MIT license.



As of PyBlosxom 1.4, we have support for Paste. This document covers installing and using PyBlosxom with Paste.

This document is in a "works for me" status. Any help to flesh it out to be more generally useful is greatly appreciated.

This installation assumes you have some understanding of Python Paste. If this doesn't sound like you, then you can read up on Paste on the Paste web-site.

Paste support is pretty new, still. If you have problems, check our web-site and feel free to ask questions on the pyblosxom-users mailing list. Details of the mailing list are on our web-site on the Contact us page.


A note about upgrading PyBlosxom:

If you are upgrading your version of PyBlosxom, follow the instructions here and also read the README that comes with your PyBlosxom tarball for differences between this version and the previous versions. The README file contains instructions on updating your file, templates, and other parts of your PyBlosxom installation which you will have to do by hand.

Pre-requisites for installing PyBlosxom with Paste

You will need:

Additionally, if you're using an earlier version of Python than Python 2.5, then you'll also need:

Additionally, if you are running PyBlosxom on Windows, you will also need:


You can find versions of PyBlosxom by going to the Download link at .

Download the latest PyBlosxom .tar.gz file.


Installing PyBlosxom with Paste should take 5-10 minutes depending on what state your system is currently in. The installation consists of a few steps. Tweaking, styling, and adding content to your blog is covered in other parts of the documentation.

  1. Download PyBlosxom from the PyBlosxom site.

  2. Untar PyBlosxom:

    tar -xzvf pyblosxom*.tar.gz
  3. Either:

    3.1. install PyBlosxom as a Python library by doing

    python install, OR

    3.2. add PYTHONPATH=/path/to/Pyblosxom/parent/ to your

    environment variables

  4. Create a directory to hold your blog. This will be a parent directory of your datadir. Also create directories for entries, flavours, and plugins.

    Here's an example file-system layout:

       |- blog/
          |- entries/
          |- flavours/
          |- plugins/
          |- blog.ini
  5. Copy blog.ini from pyblosxom/web into your blog directory.

  6. Copy from pyblosxom/web into your blog directory.

  7. Edit blog.ini and -- see instructions in configuration section. Be sure to set the configpydir property.

  8. If you left use, host, and port at the defaults, then you can run your blog like this:

    paster serve blog.ini

    paster will print the URL for your blog on the command line.


    If the host of your blog is or, then your blog will be visible ONLY from the same machine it is running from.


Paste configuration is done in an .ini file.

Create a blog.ini that holds information that Paste needs to run your blog.

An example blog.ini is here:

debug = True

use = egg:Paste#http
host =
port = 5000

paste.app_factory = Pyblosxom.pyblosxom:pyblosxom_app_factory
configpydir = /path/to/dir

# PyBlosxom config here
blog_title = Joe's Blog
blog_description = This is Joe's test blog.
blog_author = Joe
blog_email =
datadir = /home/joe/blog/entries/
num_entries = 5

There are several things to note here:

  1. In the [server:main] section, define the host and port of your blog. Using and 5000 is really useful for building a test environment that only someone on the machine the blog is running on can see. When you want to make your blog public, you can set the host to your ip address and the port to something more reasonable.

    There's more information on configuring Paste on the Paste Deployment site.

  2. The [app:main] section needs to have the paste.app_factory defined--this tells Paste where the PyBlosxom WSGI app factory function is.

  3. Define the configpydir property in the [app:main] section. The value of this property is the directory that your file is in.

    For example, if you put your file in /home/joe/blog/, then set your configpydir like this:

    configpydir = /home/joe/blog/
  4. You can define PyBlosxom config properties in the [app:main] section as well. Properties declared here will override properties declared in your file. This is really handy for building a testing environment blog on a different port.

    You don't have to define any config properties in the blog.ini file--you can define them all in your file.


    Defining PyBlosxom config properties in an .ini file is a bit of a trick since .ini files treat all keys and values as strings but not all config properties have string values.


Import Error: No module named Pyblosxom.pyblosxom

If you installed PyBlosxom as a Python library (i.e. you did python install), then the problem is probably that you have multiple versions of Python on your system and paster is using a different one than the one you install PyBlosxom into.


paster --version

and see if that matches the version of Python you installed PyBlosxom into. If it doesn't match, then you need to install PyBlosxom into the version of Python that paster is using.

If you didn't install PyBlosxom as a Python library, then you need to add the directory that the PyBlosxom code is in to the Python sys.path. The easiest way to do that is to set the PYTHONPATH environment variable to the directory that PyBlosxom is in.

For example, I untarred PyBlosxom into /home/joe/ and I have a directory tree like this:

      |- pyblosxom/
         |- Pyblosxom/
            |- ...

I then set PYTHONPATH like this:

% export PYTHONPATH=${PYTHONPATH}:/home/joe/pyblosxom/