Title photo
frugal technology, simple living and guerrilla large-appliance repair
Fri, 21 Dec 2012

Nikola, a static site/blog generator written in Python

A peek at the Planet Python blog aggregator (I'm a big Planet blog fan, in case you didn't know) clued me in to a project I'd never heard of before: Nikola, a static website/blog generator.


The project site looks pretty good, and there's a nice "handbook" with information on how to install, configure and use Nikola to create static websites with its Python backend. New releases are announced in a blog built with Nikola.

A list of sites built with Nikola provides a few examples of the system's stock theme.

Features in Nikola include tagging for entries, archiving, Disqus comments and easy-to-use image galleries.

Part of what made me notice Nikola is its use of Python. I find that the best way to get to know a programming language is to use applications made with it.

Right now, I'm pretty much at the end of my look at Nikola. My system is running Debian Wheezy -- the soon-to-be-stable GNU/Linux release that I use for just about everything. Nikola isn't in Wheezy, Debian's current Testing distribution (slated to go stable sometime next year).

Right now Nikola is in the Debian Sid (aka Unstable) repository. So are many of its dependencies. I tried to install it on my Wheezy system using .deb files and the gDebi package management tool, but it's not happening.

I also tried the Nikola Handbook's preferred method of installation using Python's pip utility. (I got pip in Debian Wheezy package python-pip.)

Both installation attempts (.deb packages from Sid and pip) failed. With pip I was able to get Nikola installed, and I created a test site, but it wouldn't build. I got the following output in the terminal:

$ nikola build
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/doit/doit_cmd.py", line 97, in run
    return self.sub_cmds[command].parse_execute(args)
  File "/usr/local/lib/python2.7/dist-packages/doit/cmd_base.py", line 56, in parse_execute
    return self.execute(params, args)
  File "/usr/local/lib/python2.7/dist-packages/doit/cmd_base.py", line 209, in execute
    args)
  File "/usr/local/lib/python2.7/dist-packages/doit/cmd_base.py", line 171, in load_tasks
    params['seek_file'])
  File "/usr/local/lib/python2.7/dist-packages/doit/loader.py", line 86, in get_module
    return __import__(os.path.splitext(file_name)[0])
  File "/tmp/tmpc7zWs8.py", line 8, in 
    import conf
ImportError: No module named conf

Not knowing Nikola or Python very well but looking at similar error output from other programs (thanks, Google), I'm suspecting that the conf.py file isn't being picked up by Nikola, even though it's where it is supposed to be. I could (and probably am) totally wrong.

I posted my error output to the Nikola forum on Google Groups. Maybe somebody will have a fix.

Other static-site generators written in Python:

[Pelican](http://blog.getpelican.com/)