def app_remove(request, app_id): if request.method != 'POST': return HttpResponseNotAllowed(['POST']) try: DataHubManager.remove_app(app_id=app_id) return HttpResponseRedirect(reverse('browser-apps')) except Exception as e: c = {'errors': [str(e)]} c.update(csrf(request)) return render_to_response('apps.html', c)