Post tagged: web-development

IPython notebooks in Pelican

Adding an obvious feature to Pelican.

IPython notebooks are an incredibly useful way to do reproducible research and illustrate chunks of code. Obviously you'd like to put some of them on the web. Surely there must be an easy way to include them in a Pelican-based website. So why hasn't anyone done it yet?

They have …

Logging PHP errors

Somehow, this feels like a personal failing.

The scenario

I try to avoid PHP as much as possible (just not my thing) but I'd installed a PHP-based webapp (REDCap) and there was something occuring that seemed like it should have generated an error. However I could not find any PHP errors logged anywhere on the machine. So …

Porting this site to Pelican

On making a simpler website in a slightly complicated way.


Way, way back, this site ran on various permutations of PHP-based frameworks. Getting sick of ugly URLs and having to vigilantly update the software so as to avoid hacks (and still periodically falling victim to various hacks), I went in search of a Python-based framework that I could customize …

Using Paperclip for attachments

Doing something more than a toy example

This is not as straightforward as it seems.

In development, it works fine. Simply declare that the model has an attachment:

class Download < ActiveRecord::Base
        has_attached_file :attachment

and stuff will work automagically. A directory “system” will be created in your public folder and the attachments will be created in there …

Django form fields

A pointer on how to process them.

Django's form generation machinery for the most part is fine and straightforward, but on a recent project I ran into problems with a form that accepted files. The documentation is all there, but changes in how things work and an emphasis on forms for models make things harder to understand …

Can I use RMagick?

A simple question, with the answer simply laid out for you.

RMagick is necessary for a lot of Ruby packages, so the restrictions on using it are critical (and very annoying). Here are the constraints on what can be used where:

Ruby 1.8 RMagick 1 RMagick 1
Ruby 1.9 RMagick 2

Or to put it another way: if you …

Creating a Hobo project

A step-by-step guide to setting up Hobo development.

Hobo is a nifty thing, a better Rails than Rails, but there are a number of small roadbumps to getting a project started. This is a list of one possible way through the maze.


  • You're working in a Unix-like environment
  • For development purposes, you will be building a sandboxed …

write argument must be string

When wsgi won't work.

So I was writing a web application using WSGI and - after working for a long time - it started erroring out with:

AssertionError: write() argument must be string

from deep inside the WSGI handler. Now, this usually means that you're returning unicode, which WSGI can't handle. However, it's quite happy to …

Tips & tricks

Some brutal experience gained while learning to love Zope.


Ah, archetypes. How I adore thee. Other ways of constructing Plone content are as nothing before me. You are quick to develop, flexible in your approach, sensible in your defaults. But cryptic in your errors.

A lesson or two on breaking archetypes: First, not all fields accept all widgets …

Changing a user's password

When "reset password" fails.

How do you give a user a new password? Well, in the "User & Groups" control panel, you select reset password for them. What if they've lost or changed their email address? In the same place, set the new one. What if "that doesn't work"? You can assign them a new …

Installing PloneRSS

Notes for the less persistent.

One of Plone's marked faults has been the lack of an out-of-the-box RSS aggregation product. Although there have been a number of attempts (CMFSin, CMFNewsFeed, CMFFeed), these are unfinished, quirky or only semi-functional. Fortunately, PloneRSS is a robust solution for gathering and publishing newsfeeds on your site. Unfortunately, installation is …

One great big bag of Plone problems

Assorted bugs, weirdness and some solutions.

Whenever I get a cryptic error from Plone (which is all too frequently), I google to see if anyone else has it. This is me paying back into the system.

Can't add type: 'NoneType has no attribute get'

After fiddling with the schema on a type, adding it then failed …


Simple utilties for Plone product initilisation and installation.



This library was developed for personal use during the bad old days of Plone development around version 2.5. It almost certainly does not work with Plone 3+ and is kept here for historical interest.

This library originated from a desire to do away with the large amount …

On the debugging of page templates

... and form controllers and macros and webforms ...

Try embedding something like this in your code:

<dl class="collapsible inline collapsedOnLoad">
<dt class="collapsibleHeader">Title</dt>
<dd class="collapsibleContent">
<span tal:replace="structure python: here.printRequest(request,
errors)"/> </dd>

and supply the necessary printRequest somewhere in your code or as a script:

def printRequest (self, request, errors …

Restoring viewlets

How do you get a Plone theme to uninstall and restore viewlets to the usual way. That is the mystery ...

The symptoms

In a theme I recently built, I moved or hid several viewlets around for artistic effect. The problem didn't show itself until I uninstalled the theme. The viewlets …

The incident of the missing form script

The incident of the missing form script, another Plone mystery.


While developing a series of forms using CMFFormController, suddenly one of the components couldn't be found.

To recap (and serve as an example to those neophytes), CMFFormController structures your forms as a series of form templates or scripts with metadata files determining how execution moves between them. In this …

Upgrading to 2.1.x

Some notes on the process of updating your Plone site software.

The process of upgrading a Plone site can be intricate. The 2.0.x to 2.1.x jump is no different. (Anyone who has followed the series of quirks and bugs in over the early part of 2006 will have seen the evidence.) While you could just …