def new_interview(request): ip_address = request.remote_addr try: Interview.clear_and_reset() rules_fired = Interview.next() except KnowledgeBaseError, instance: return Response(instance.args[0], content_type='text/plain', status_int=500)