def get(self, imgid):

            name = self.request.path.split("/")[2]
            image = Image.get_by_name(name)
            if image and image.file:
                self.response.headers["Content-Type"] = "image/PNG"
                self.response.out.write(image.file)
            else:
                self.json_out({"name": name})
Example #2
0
 def get(self):
   contents = Content.all().fetch(1000)
   theme_packages = ThemePackage.all().fetch(1000)
   themes = Theme.all().fetch(1000)
   pages = Page.all().fetch(1000)
   images = Image.all().fetch(1000)
   roles = Role.all().fetch(1000)
   sections = Section.all().fetch(1000)
   _users = User.all().fetch(1000)
   actions = ACTIONS
   template_values = {'logout_url':self.ws.users.create_logout_url('/'),'theme_packages': theme_packages,'themes': themes, 'images': images, 'pages': pages, 'contents':contents, 'roles':roles, 'users':_users, 'actions': actions, 'sections': sections, 'site': self.ws.site}
   self.response.out.write(template.render('templates/manage.html',template_values))