‘module’ object has no attribute ‘day_abbr’

July 4th, 2008

This means you have a naming conflict between the core python module calendar and another one which is taking precendence.

If you’ve got your own module called calendar, rename it…

More Wii Fit goodies

June 30th, 2008

Now I’ve got a Wii Fit, I want other games to play on the board :-)

Wii Fit Games Info

How to access the Django request inside a Template Tag

June 21st, 2008

You can access the Django request within a Template Tag by enabling the request context processor.

If you’re using a generic view, for example, ‘direct_to_template’, your render() function will then be passed a RequestContext , and you can access the request by context[’request’].

If you’re not using a generic view, and are using render_to_response(), then you have to explicitly pass context_instance=RequestContext(request) as the third parameter.

You enable the request context processor by adding this to your settings file:

TEMPLATE_CONTEXT_PROCESSORS = ('django.core.context_processors.request',)

You might also need to add back the default context processors. These vary from version to version - check the django documentation for the settings file for details.

For example, in 0.96, I’ve got this in my settings file

TEMPLATE_CONTEXT_PROCESSORS = ('django.core.context_processors.request',
'django.core.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
)

Learning Spanish

June 17th, 2008

Just finished my first year of learning spanish. Here’s a page with links to various things I found useful: podcasts, TV shows, and books - Learning Spanish

Where can I buy a Wii Fit?

May 17th, 2008

Trying to get a Wii Fit is almost impossibile - none of the shops have any in stock. Even Amazon has stocks only for a few minutes each time they get some before they’re all gone. Very frustrating! So one quiet evening, I wrote a real-time stock checker to tell me when they were in stock.

And now I’m the happy owner of a Wii Fit, and very excellent it is too…

And then I thought, hmm, that’s a good idea, so I bagged a domain name and here’s the website - Where Is It In Stock?

How Safe is Your Money?

March 24th, 2008

A new website I’ve been working on… http://www.howsafeisyourmoney.co.uk

underwater iPod

March 24th, 2008

Looking for a way of going swimming/kayaking/windsurfing with your iPod? I can thoroughly recommend the H3 headphones and iPod Shuffle case, both made by H20 Audio.
Read the rest of this entry »

installing mysql5 with php5 on Ubuntu for Wordpress

December 20th, 2007

You need to install php5-mysql.

And then don’t forget to restart Apache. Just reloading won’t work.

2 essential rescue CDs…

December 17th, 2007

For when you need to resize the partition you usually work in

GParted LiveCD

And for when you’ve muffed up your grub installation, and can’t work out how to use grub-install

Super Grub Disk

“AttributeError: ‘module’ object has no attribute ‘blah’”

December 12th, 2007
  • The obvious cause of this is that the settings.py doesn’t have the directory containing blah listed in INSTALLED_APPS.
  • A less obvious cause: you’ll also get this error if the directory doesn’t contain a file __init__.py.