examples/simple_site/handlers.py
def prepare(self):
        """ Load the view on first load """
        if self.__class__.view:
            return
        
        #: Load the View class from the dotted view name
        with enaml.imports():
            View = pydoc.locate(self.page.view)
        assert View, "Failed to import View: {}".format(self.page.view)
        
        #: Set initial view properties
        self.__class__.view = View(
            site=self.site,
            page=self.page,
            request=self.request,
        )
def prepare(self):
        """ Load the view on first load """
        if self.__class__.view:
            return
        
        #: Load the View class from the dotted view name
        with enaml.imports():
            View = pydoc.locate(self.page.view)
        assert View, "Failed to import View: {}".format(self.page.view)
        
        #: Set initial view properties
        self.__class__.view = View(
            site=self.site,
            page=self.page,
            request=self.request,
        )
Load the view on first load