Blog's control panel: | Home | Tags | Index | Rss 2.0

Pyblosxom's comments with antispam (akismet) support

Tue, 22 May 2007 | Permalink | Tags: ,

After a long while I was convinced to add comments support to the blog. I was sceptical, a) because I'm not really expecting lots of comments, b) because it looked a lot of pain. It turned out to be not too bad, altho I found comments from the author and others a bit confusing and sometimes even contradicting.
First of all you need to download the plugins bundle here. Then you need to copy the following files from the plugin directory:

comments.py
akismetcomments.py
akismet.py
comments.py
and put them in your plugin directory.
Then you want to add at least the following in your config.py:
# Load the plugins
py['load_plugins'] = [all_your_other_plugings,'akismetcomments','comments']
#akismet
py['akismet_api_key'] = 'YOURKEY'
#comments
py['comment_dir'] = "/path/to/blog/to/comments/"
Last parameter must be a dir writable by the user your blog runs as. For the akismet key see this page.
I dont use the ajax/preview stuff so if you want them check out the original documentation.
The last thing you might want is to patch the comment-form.html template to include the flavor in the url for the form's POST, otherwise comments will be saved/loaded for the post's page and not displayed if you visit post.$flavour.
form method="post" action="$base_url/$file_path.$flavour" accep...
The last step is to modify the css so the comments part fits nicely. That's all, enjoy, and thanks to the pyblosxom's folks.




SpikeLab.org is a Filippo Spike Morelli copyright 2005-2008
This work is licensed under Creative Commons Att-SA License.