As I wondered, the problem was that I was accessing the site using my temporary link from BlueHost, which the function throwing the error could not handle.
When my clients finally pointed their domain name at the server this problem and a few others (CSS inconsistencies in the Django admin, trouble with .htaccess) disappeared. Everything is up now and working fine.