Django's default tests fail
May 16 2012This bug has caught me a few times so I figure I'll share it. The default tests fail with errors like:
AssertionError: False is not True : Couldn't find 'Message 1' in response ... KeyError: 'user'
These two failures occurred when I added the authentication and messages middleware but not their template context processors. In settings.py I needed something like:
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
)
Hopefully this helps someone out there.
Sam Odio on the web: Crunchbase | Angellist | Linked In | Quora | Google+ | Github
About
Hi, I'm Sam Odio. I'm a snowboarder, off-roader, developer and a life-hacker.
I've worked on a bunch of different projects. My favorites have been a touch-screen controlled bus, a photo sharing site called Divvyshot, and Facebook Photos... more.
Sub-blogs
Winter 2012 YCombinator Batch
March 27 2012Filed under: home Startups YCombinator
The first time I went through YCombinator, it was in a batch of 14 companies. The most recent batch 59 demoed (39 publicly). They've outgrown the YCombinator demo space and have moved to an auditorium in Mountain View's Computer History Museum - with a seating capacity of 380.
I was lucky enough to attend YCombinator's Alumni Demo Day last night (where the startups do a practice run-through of their pitches). Here's a quick summary of the public companies with my thoughts:
AnyPerk: Discounts as an employee benefit. Founders have all been part of previous compnaies that have ... more
Touch-screen bus
January 08 2012When I was 17 my brother asked me to build a touch-screen interface for a bus he had recently purchased. The screen was to serve as the dashboard, controlling the turn signals & headlights, starting the engine, opening the door, etc.

To complete this project I used a rabbit embedded microcontroller similar to the SBC BL4S200. You can get one for as little as $250 today. A budget computer connected to the touch screen via USB & VGA and communicated with the microcontroller via a serial port. I then reverse-engineered the relays on the bus to determine their function (ie, power the ... more
sam.odio.com has a new blog.
August 11 2011Filed under: home
Since moving off Blogger (here's why) and loosing all of my blog's comments my blog has fallen into a bit of disuse. Now that I'm freshly unemployed (at least, that's how my Dad calls it) I aim to change that.
Action items:
- Create an open source lightweight django blog.
- Crowd-source a blog design using crowdspring.
- Realize that crowd-sourcing is a failure, convince Michael to donate his time and patience to fix it.
- Port all old blog posts to new platform.
- Port all comments (which have recently disappeared) to new platform.
- Make myself a Margarita and relax ... more