Get flash messages working under Django app
Clean up a bit of code after re-reading it