New Labour

I come from a North English town, a family that strongly supports Labour and a community that believes in traditional Labour values.

The recent turmoil in British politics has me activated. I’ve been thinking about lots of things and people are probably not surprised to hear that I support Corbyn. In the same way that I support Bernie Sanders here in the USA.

But I’m also trying to be critical of all this politics, because Science based Policy is something we desperately need in many places. When Gove started tearing into the education system in the UK, the process was driven by arrogance. The assumption that Gove and friends knew better than any body and were ill prepared to try to experimentally define policy. They didn’t define what results were being sort, have any exit in place for a policy that’s failing and what kind of remuneration is available for policies that fail and leave people worse off.

I’m still very much a socialist in the European sense and I’ll continue to believe that people are mostly good, mostly do better working together and caring for people is not always a bad thing. But I want to be just as critical of socialist policy as I would of neo-liberal policy. I’d like to see that any assumption about what policy might work, might be thought deeply about and all policies not be held quite so inflexibly to heart. Because we might find that it’s just not doing what we think it is.

How strong would we be if we could fail without fear.

Django Projects

I haven’t posted in a two years. I don’t know if anyone is still following my blog or not, but if you are. Hello and thanks for your patience.

These last few years I’ve been doing a lot of django contracts. It seems like every man and he’s dog business wants a django website to do complicated things involving user data. And django has matured in the last few years to become more sensible and consistent.

I remember back in 2009 talking with a developer about migrations support and how django had really let us all down by not really having it’s own migration framework built in. Now though, we have what is a pretty good (but not perfect) migration system.

These are some of the things that I have to do for many of the django projects I work on.

  • django-autotest – A way to run the testing framework over and over again without re-creating the database schema, auto rerun on file changes, shell title bar status updates, some nice base test extras like getting objects, making requests and setting up sessions which often crop up in test code. (include useful haystack base tests too)
  • django-fast-fixtures – A wrapper for dumpdata and loaddata to have media in fixtures. Useful for those statuses with icons and those tests with media files.
  • cache middleware – Caching middleware. When using django-cms, it’s VERY important to use the full page cache. Without it, your site is dead (or at least inkscape’s website would be) I’m still working on the expiration logic for all object types.
  • django-cats – I’ve been trying to convert my haystack/django category and search view into it’s own module. So far, it’s in a collection module I’ve used with multiple projects. The basic idea is that you can make a view that can slice up a queryset into multiple categories and haystack searches. Categories provide counts and easy to display and link iterators for templates. As well as the handy automatic haystack attribute creation and url key word support.
  • settings and admin tweaks – Most sites need a local settings template. This is because django doesn’t yet seperate out developer configuration from sysadmin configuration. So we still have to do it manually. It also doesn’t allow admin sites to be designed/changed, these two are taken care of in these standard patterns.
  • urls.py – And lastly is url_tree, a two line addition that ends up in almost all of my urls.py files as it’s just so useful. Take a look at the complexity of this urls.py, it’s made a lot more understandable by reducing the three calls into one simple call. Sometimes I tweak it to allow the view module name in too, but it’s mostly never needed.

What have you been up to in the last few years?