def get(self): if not decorator.has_credentials(): context = {"url": decorator.authorize_url(), "has_credentials": decorator.has_credentials()} template = JINJA_ENVIRONMENT.get_template("auth.html") self.response.write(template.render(context)) else: self.redirect("/admin")
def get(self): http = decorator.http() data = user_info_service.userinfo().get().execute(http=http) template = JINJA_ENVIRONMENT.get_template('admin/index.html') context = { 'data': data, } self.response.write(template.render(context))
def get(self): user = None try: user = self.session['user'] except: self.redirect('/login/') if user: context = {'data': user, } template = JINJA_ENVIRONMENT.get_template('dashboard/index.html') self.response.write(template.render(context))
def get(self, file_id): if file_id: try: file_id = str(file_id) report = ndb.Key(urlsafe=file_id).get() if report: self.response.headers['Content-Type'] = 'application/xlsx' self.response.headers['Content-Disposition'] = 'attachment; filename=' + str(report.name) self.response.write(report.export_file) except Exception, e: logging.error(e) template = JINJA_ENVIRONMENT.get_template('attach/attach_notexist.html') self.response.write(template.render())
def get(self, file_id): if file_id: try: file_id = str(file_id) attach = ndb.Key(urlsafe=file_id).get() if attach: self.response.headers['Content-Type'] = mimetypes.guess_type(attach.nombre)[0] self.response.headers['Content-Disposition'] = 'attachment; filename=' + str(attach.nombre) self.response.write(attach.archivo) except Exception, e: logging.error(e) template = JINJA_ENVIRONMENT.get_template('attach/attach_notexist.html') self.response.write(template.render())
def get(self): template = JINJA_ENVIRONMENT.get_template('user/login.html') self.response.write(template.render())
def get(self): user = None user = self.session['user'] context = { 'data': user, } template = JINJA_ENVIRONMENT.get_template('user/profile.html') self.response.write(template.render(context))