from twisted.web import resource class MyGreatResource(resource.Resource): def render(self, request): return "<html>foo</html>" resource = MyGreatResource()