Kind of a minor point but there is a built in decorator which already does this: https://docs.djangoproject.com/en/1.5/topics/auth/default/#the-permission-required-decorator