I have a permission that works on a view:
@permission_required('app.admin_foo')
def fooView(request, id=None):
...
But the default behaviour is to redirect to a login. How can I get Django to redirect to another view when the permission is denied? E.g.
return redirect(reverse('bar'))
Update
For your information, Django can be set up to redirect to a custom 403 page when a permission check fails. See Flimm's answer on this page: Django, creating a custom 500/404 error page