def login(): withsession.session = request.environ.get("beaker.session") loggedin = request.cookies.get("loggedin") if request.method == "GET" and not loggedin and loggedin not in withsession.session: return template("admin/views/login.jinja2") elif request.method == "GET" and loggedin and loggedin in withsession.session: redirect("index") else: try: postedname = request.forms.get("username") postedpassword = request.forms.get("password") if postedname and postedpassword: user = Users.objects.get(username=postedname, password=base64.b64encode(bytes(postedpassword, "UTF8"))) if user: global username guid = uuid.uuid1() username = user.username withsession.session["loggedin"] = str(guid) response.set_cookie("loggedin", str(guid), max_age=600) return template("admin/views/index.jinja2") else: return template("admin/views/login.jinja2", {"errorMessage": "Invalid Username or Password"}) else: return template("admin/views/login.jinja2") except Exception as e: return template("admin/views/login.jinja2", {"errorMessage": str(e)})
def view_debug(query=''): if 'metrics_file' in errors: body = template('templates/snippet.errors', errors=errors) return render_page(body, 'debug') if not data_ready(): return "server is still building needed datastructures. can't continue" if query: query = parse_query(query) targets_matching = match(targets_all, query) graphs_matching = match(graphs_all, query, True) graphs_targets, graphs_targets_options = build_graphs_from_targets(targets_matching, query) targets = targets_matching graphs = graphs_matching else: graphs_targets, graphs_targets_options = build_graphs_from_targets(targets_all) targets = targets_all graphs = graphs_all args = {'errors': errors, 'plugins': s_metrics.plugins, 'targets': targets, 'graphs': graphs, 'graphs_targets': graphs_targets, 'graphs_targets_options': graphs_targets_options } body = template('templates/body.debug', args) return render_page(body, 'debug')
def process_signup(): connection = pymongo.Connection(connection_string, safe=True) email = bottle.request.forms.get("email") username = bottle.request.forms.get("username") password = bottle.request.forms.get("password") verify = bottle.request.forms.get("verify") # set these up in case we have an error case errors = {'username':cgi.escape(username), 'email':cgi.escape(email)} if (user.validate_signup(username, password, verify, email, errors)): if (not user.newuser(connection, username, password, email)): # this was a duplicate errors['username_error'] = "Username already in use. Please choose another" return bottle.template("signup", errors) session_id = user.start_session(connection, username) print session_id cookie= user.make_secure_val(session_id) bottle.response.set_cookie("session",cookie) bottle.redirect("/welcome") else: print "user did not validate" return bottle.template("signup", errors)
def render_main_page(acsrf,ses_id): if (not PriceHistoryAuth.auth.is_valid_acsrf(ses_id,acsrf)): return template('Login',message='Improper Credentials or Timeout.', extra_login_methods=EXTRA_LOGIN_METHODS, feedback_email=FEEDBACK_EMAIL, footer_html=FOOTER_HTML, goog_anal_script=GoogleAnalyticsInclusionScript) PriceHistoryAuth.auth.update_acsrf(ses_id) search_string = request.forms.get('search_string') search_string = search_string if search_string is not None else "" commodity_id = request.forms.get('commodity_id') PriceHistoryAuth.LogActivity.logPageTurn(ses_id,"MainPage") return template('MainPage',search_string=search_string,\ acsrf=PriceHistoryAuth.auth.get_acsrf(ses_id),\ session_id=ses_id,\ feedback_url=LocalURLToRecordFeedback,\ footer_html=FOOTER_HTML,\ portfolio_panel=PORTFOLIO_PANEL,\ column_dropdown=COLUMN_DROPDOWN_HTML,\ mainjs_includes=MAINJS_INCLUDES,\ slickgrid_includes=SLICKGRID_INCLUDES,\ jqplot_includes=JQPLOT_INCLUDES,\ commodity_id=commodity_id,goog_anal_script=GoogleAnalyticsInclusionScript)
def users(user): if user != None: counts = user.followees_count,user.followers_count,user.post_count return bottle.template('users',users=Functions.getUsers(),page='timeline',username=user.username, counts=counts,posts=user.posts()[:1],logged=True) else: return bottle.template('guest/users',users=Functions.getUsers(), page='timeline',logged=False)
def post_test_custom(): cookie = bottle.request.get_cookie("session") username = sessions.get_username(cookie) if username is None: bottle.redirect("/login") topics = set([question['topic'] for question in questions.get_all_questions()]) name = bottle.request.forms.get("name") pct_lower = bottle.request.forms.get("pct_lower") dest_level = bottle.request.forms.get("dest_level") roles = users.get_roles(username) if 'admin' not in roles and 'template-creator' not in roles: errors = "User does not have permission to create templates." return bottle.template("custom_test", dict(username = username, errors = errors, name = name, pct_lower = pct_lower, selected_level = dest_level, topics = topics)) if name == "" or pct_lower == "" or dest_level == "": errors = "Custom test template must have values for all options." return bottle.template("custom_test", dict(username = username, errors = errors, name = name, pct_lower = pct_lower, selected_level = dest_level, topics = topics)) topic_counts = {} for topic in topics: topic_counts[topic] = int(bottle.request.forms.get(topic)) print "Inserting custom template..." template_id = test_types.insert_test_type(name, 100 - int(pct_lower), int(dest_level), topic_counts, username) bottle.redirect('/test/{}'.format(template_id))
def process_signup(): signup_enabled = preferences.get_preference('signups') if signup_enabled is None or not signup_enabled == 'enabled': bottle.redirect("/") email = bottle.request.forms.get("email") username = bottle.request.forms.get("username") password = bottle.request.forms.get("password") verify = bottle.request.forms.get("verify") # set these up in case we have an error case errors = {'username': cgi.escape(username), 'email': cgi.escape(email)} if validate_signup(username, password, verify, email, errors): if not users.add_user(username, password, email): # this was a duplicate errors['username_error'] = "Username already in use. Please choose another." return bottle.template("signup", errors) session_id = sessions.start_session(username) print session_id bottle.response.set_cookie("session", session_id) bottle.redirect("/") else: print "user did not validate" return bottle.template("signup", errors)
def start_handler(): if 'user_context' not in request.session: # valence user not yet auth'd -- start the process from scratch aurl = _ac.create_url_for_authentication( host=_CFG['lms_host'], client_app_url=_AUTH_CB, encrypt_request=_CFG['encrypt_requests']) # redirect to the valence auth entry point on the LMS return template('needsAuth', aurl=aurl) else: # we do have a user context so render the profile form page uc = _ac.create_user_context( d2l_user_context_props_dict=request.session['user_context']) user_profile = d2lservice.get_my_profile( uc, ver=_CFG['lms_ver']['lp'], verify=_CFG['verify']) return template( 'profileChange', host=_CFG['lms_host'], port=_CFG['lms_port'], nickname=user_profile.Nickname, email=user_profile.Email)
def signup(): email = request.forms.get("email") username = request.forms.get("username") password = request.forms.get("password") verify = request.forms.get("verify") # set these up in case we have an error case errors = {'username': cgi.escape(username), 'email': cgi.escape(email)} if validate_signup(username, password, verify, email, errors): if not users.add_user(username, password, email): # this was a duplicate errors['username_error'] = "Username already in use. Please choose another" return template("welcome/signin", errors) session_id = sessions.start_session(username) print session_id response.set_cookie("session", session_id) redirect("/") else: print "user did not validate" return template("welcome/signin", errors.items() + dict(stylesheet=['login.css']).items() ) return template("welcome/signup")
def index(): pos = gps.get_current_position() if pos: return template('index', api_key='<GOOGLE MAPS KEY>', latitude=pos.latitude, longitude=pos.longitude) else: return template('error')
def status(): if srvstate: output = template("server_status", status='Running') return output else: output = template("server_status", status='Offline') return output
def index(): """Handler for index page""" user = users.get_current_user() if user: return template('index', name=g_name, user = user.nickname(), log_in_out = users.create_logout_url('/'), opt = 'Выход') else: return template('index', name=g_name, log_in_out = users.create_login_url('/'), opt = 'Войти')
def stats(self): start_date = request.query.date_from end_date = request.query.date_to graph_type = request.query.graph monitor = request.query.monitor qname = request.query.queue monitor_dir = os.path.join(self.config['daemon']['monitors_dir'], monitor + '/rrd') ### validated_data = tuple(start_tim_in_utc, delta_in_secs) -- наверное, есть смысл переделать в словарь это добро ### gen_image завязан еще в common_check() в классе монитора, поэтому выпилить enddate оттуда пока сложновато validated_data = self.validate_dates(start_date, end_date) if None in validated_data or not monitor or not qname: return bottle.template('404.html', start_date=start_date, end_date=end_date, monitor=monitor, qname=qname) # проверка, не пытаются ли запросить js-график для сета данных БОЛЬШЕ 7 дней if validated_data[1] > 604800 and graph_type == 'js-graph': return ''' <script> alert(\'Time interval is too long for using js-graph! You can use it MAX for 7 days.\') location.replace("/"); </script> ''' if graph_type == "rrd-graph": RRDer.gen_image(None, os.path.join(self.static_path, 'pictures'), monitor_dir, qname, validated_data[0]+validated_data[1], validated_data[0]) return bottle.template("rrdgraph.html") elif graph_type == 'js-graph': fails_for_queue = self.get_csv_files_for_queue(monitor, qname, validated_data[0], validated_data[1]) return bottle.template("jsgraph.html", queue=qname, fails_list=fails_for_queue) else: return "OUT OF CONTROL!"
def inicio(): buscar = request.forms.get('buscar') cantidad = request.forms.get('cantidad') video="channel" key=os.environ["Key"] part='id,snippet' payload={"part":part,"key":key, "q": buscar, "maxResults":cantidad, "type":video} r=requests.get('https://www.googleapis.com/youtube/v3/search',params=payload) if r.status_code==200: js=json.loads(r.text) lista_ti=[] lista_id=[] lista_foto=[] for x in js['items']: lista_id.append(x['id']['channelId']) lista_ti.append(x['snippet']['title']) lista_foto.append(x['snippet']['thumbnails']['default']['url']) if len(lista_id) != 0: return template('formulario_canales.tpl', lista_id=lista_id, lista_ti=lista_ti, lista_foto=lista_foto, buscar=buscar) else: return template('error1.tpl') else: return template('error1.tpl')
def translate_identifiers(): if 'ids' not in request.forms: return template('translate', { 'results': None, 'namespaces': namespace_fullname.items(), }) inputns = request.forms['inputns'] outputns = request.forms['outputns'] results = [] for i in request.forms['ids'].strip().split(): i = i.strip() if not len(i): continue e = translate(i, inputns, 'ensembl:gene_id') o = translate(e, 'ensembl:gene_id', outputns) results.append((i,e,o)) if format == 'csv': return '\n'.join('\t'.join(r) for r in results) if format == 'json': from collections import namedtuple rtype = namedtuple('WaldoIDTranslation', 'input ensembl_gene output') results = [rtype(r) for r in results] return json.dumps(results) return template('translate', { 'results': results, 'inputns_user' : namespace_fullname[inputns], 'outputns_user' : namespace_fullname[outputns], 'namespaces': namespace_fullname.items(), })
def radio(successfully_saved=False): if not helpers.player.is_installed(): return template("radio-instructions") radios = sorted(storage.read('radio').items()) helpers.current_tab("radio") return template("radio", radios=radios, successfully_saved=successfully_saved)
def wrapper(*args, **kwargs): req = bottle.request # Check if the the sessions exists and is valid, then load the app if helpers.session.is_logged(req.get_cookie('session','')): return callback(*args, **kwargs) # Don't require auth for the static content if req.path.startswith('/static'): return callback(*args, **kwargs) # Check if the user is sending its credentials elif req.params.get('username'): username = req.params.get('username') password = req.params.get('password') if check_login(username, password): # Login successfull! Create the session and set the cookie uuid = helpers.session.create() bottle.response.set_cookie('session', uuid) # It would be nice to use a redirect here but since I'm # setting a cookie it is not the best idea ever return index() else: return template('login') # Bad login! # If the IP is whitelisted, let them in elif helpers.in_whitelist(config.AUTH_WHITELIST, bottle.request.remote_addr): return callback(*args, **kwargs) # You are not authenticated yet or don't have a valid session return template('login')
def user(): s = request.environ.get('beaker.session') username = s.get('username') oldpwd = request.forms.get("oldpwd") newpwd = request.forms.get("newpwd") newpwds = request.forms.get("newpwds") sql = " select passwd from user where username=%s " result = readDb(sql,(username,)) if result[0].get('passwd') != LoginCls().encode(keys,oldpwd) : msg = {'color':'red','message':u'旧密码验证失败,请重新输入'} return template('changepasswd',session=s,msg=msg,info={}) if newpwd != newpwds : msg = {'color':'red','message':u'密码两次输入不一致,请重新输入'} return template('changepasswd',session=s,msg=msg,info={}) m_encrypt = LoginCls().encode(keys,newpwd) sql2 = " update user set passwd=%s where username=%s " result = writeDb(sql2,(m_encrypt,username)) if result == True : wrtlog('User','更改密码成功',username,s.get('clientip')) msg = {'color':'green','message':u'密码更新成功,后续请以新密码登录系统'} return template('changepasswd',session=s,msg=msg,info={}) else: wrtlog('User','更改密码失败',username,s.get('clientip')) msg = {'color':'red','message':u'密码更新失败,请核对错误'} return template('changepasswd',session=s,msg=msg,info={})
def printer(): if request.method == 'POST': from project.models.Printer import Printer printer = Printer() message = printer.show_string(request.forms.get('text')) return template('printer/index', message = message) return template('printer/print', message = '')
def user(db, lang, username=None, format=None): params = query._params() if username: params.users = utils.pg_escape(username.decode("utf-8")).split(",") params.limit = 500 params.full = True username = "******".join(params.users) if not params.users: return template('byuser/index') errors = query._gets(db, params) count = len(errors) if request.path.startswith("/api") or format == "json": out = OrderedDict() out["description"] = ["id", "item", "lat", "lon", "source", "class", "elems", "subclass", "subtitle", "comment", "title", "level", "timestamp", "menu", "username", "date"] for res in errors: res["timestamp"] = str(res["timestamp"]) res["date"] = str(res["date"]) out["byusers"] = errors return out elif format == 'rss': response.content_type = "application/rss+xml" return template('byuser/byuser.rss', username=username, users=params.users, count=count, errors=errors, translate=utils.translator(lang), website=utils.website) else: return template('byuser/byuser', username=username, users=params.users, count=count, errors=errors, translate=utils.translator(lang), website=utils.website, main_website=utils.main_website, remote_url_read=utils.remote_url_read, html_escape=html_escape)
def domain_list(): store = Store() domains = store.index() if request.headers.get("Accept") == "text/plain": return template("domains.text", domains=domains) else: return template("domains.html", domains=domains, url=url, flashed_messages=get_flashed_messages())
def userForm(action): if action == 'add': return template('user.tpl',action='add',fname=None,lname=None,email=None) elif action == 'edit': userid = request.GET['userid'] user = userDb.getUserById(userid) return template('user.tpl',action='edit', userid=userid,fname=user.fname,lname=user.lname,email=user.email)
def render_diff(self, state1, state2, view): try: if state1 == 'admin' or state2 == 'admin': raise cliapp.AppException( 'Browsing this branch is not permitted') state1 = self.state_cache.get(state1) state2 = self.state_cache.get(state2) if state1 == state2: raise cliapp.AppException('Need two different states') if state1.identifier == 'UNCOMMITTED': raw_tree1 = mustard.rawtree.Tree(state1) element_tree1 = mustard.elementtree.Tree(raw_tree1) element_tree2 = self.element_tree_cache.get(state2) return bottle.template( 'diff', tree=element_tree1, other_tree=element_tree2) else: content_id = (state1, state2, view) if not content_id in self.content: tree1 = self.element_tree_cache.get(state1) tree2 = self.element_tree_cache.get(state2) self.content[content_id] = bottle.template( 'diff', tree=tree1, other_tree=tree2) else: print 'using cached rendering of (%s, %s, %s)' % content_id return self.content[content_id] except cliapp.AppException, err: return bottle.template('error', error=err)
def show_collections(db_name): try: # Setup connection to the local mongod server connection = pymongo.MongoClient("mongodb://localhost") # Setup error controls. error_val = 0 error_message = "" # Attempt to attach a Mongo connection to the requested database. db = connection[db_name] # Attempt to retrieve a listing of all the collections in the preferred database. collections = db.collection_names() # If the collections exist, print them in the HTML template. If they don't exist show an error. if len(collections) == 0: error_val = 1 error_message = "Invalid database requested." return bottle.template('show_collections', {'error_val':error_val, 'error_message':error_message, 'db_name':db_name, 'collections':collections}) except: error_val = 1 error_message = sys.exc_info()[0] return bottle.template('show_collections', {'error_val':error_val, 'error_message':error_message, 'db_name':db_name})
def do_registro(): name = request.forms.get("name") user = request.forms.get("user") password = request.forms.get("pass") if not name or not user or not password: return template('views/registro.html',error=' ') if len(user) < 4: return template('views/registro.html',error='Su usuario debe tener por lo menos 4 caracteres.') if len(password) < 6: return template('views/registro.html',error='Su contraseña debe tener por lo menos 6 caracteres.') db = get_db() cursor = db.cursor() query_user = cursor.execute("SELECT user from usuario WHERE user = ?",[user]) result_user = query_user.fetchall() if len(result_user) > 0: return template('views/registro.html',error='El usuario ya existe.') SALT = crear_salt() hash_pass = hashlib.sha224((password + SALT).encode("utf-8")).hexdigest() cursor.execute('insert into user_salt (user, salt) values (?,?) ', [user, SALT]) db.commit() cursor.execute('insert into usuario (name,user, pass_salt) values (?,?,?) ', [name, user, hash_pass]) db.commit() return template('views/login.html',registro=True)
def getfib(): userInput = int(request.forms.get('userInput')) print "userInput = ",userInput a,b = 0, 1 mycounter = userInput mycounter = mycounter - 1 mcount = 1 myresult = [] myresult.append(a) myresult.append(b) if userInput < 0: print 'Input Error: Negative Number ',userInput return 'Input Error: Negative Number ' elif userInput <= 2: print 'Input Error: Number needs to be greater than 2', userInput return 'Input Error: Number needs to be greater than 2' else: for i in range(1,mycounter): temp = a a = b b = temp + b myresult.append(b) print "Fibonacci series for first ",userInput, "numbers" print template(" {{name}}", name=myresult) return template("<p> {{name}}</p>", name=myresult)
def home_process(user_object): """Check if a query was input and display the front page, Required to display an top_20 list that exists""" query_counter = user_object.Query_Counter query = user_object.pending_query the_submit = user_object.pending_submit user_object.pending_submit = '' user_object.pending_query = '' if the_submit != 'Submit': #no query string was input as the submit value was not receive #just display top_20 list usings template top_20_tuples = query_counter.Get_Top_20_Tuples() return template(user_page, logged_in=True, user_id=user_object.user_document['id'], user_email=user_object.user_document['email'], results=None, top_20=top_20_tuples, query_string=None) else: #a query was submitted so process it the_results = query_counter.Process_Query_String(query) if the_results == -1: top_20_tuples = query_counter.Get_Top_20_Tuples() return template(user_page, logged_in=True, user_id=user_object.user_document['id'], user_email=user_object.user_document['email'], results=None, top_20=top_20_tuples, query_string=None) for word in the_results: query_counter.Bubble_Up_Top_20(word) good_results = list(the_results.items()) top_20_tuples = query_counter.Get_Top_20_Tuples() return template(user_page, logged_in=True, user_id=user_object.user_document['id'], user_email=user_object.user_document['email'], results=good_results, top_20= top_20_tuples, query_string=query)
def index(): username = request.get_cookie('U', secret=secret()) password = request.get_cookie('P', secret=secret()) if check_user(username, password): return template('todo') else: return template('login', error=None)
def render_portfolio(): acsrf = request.forms.get('antiCSRF') ses_id = request.forms.get('session_id') if (not PriceHistoryAuth.auth.is_valid_acsrf(ses_id,acsrf)): return template('Login',message='Improper Credentials or Timeout.', extra_login_methods=EXTRA_LOGIN_METHODS, feedback_email=FEEDBACK_EMAIL, footer_html=FOOTER_HTML, goog_anal_script=GoogleAnalyticsInclusionScript) PriceHistoryAuth.auth.update_acsrf(ses_id) PriceHistoryAuth.LogActivity.logPageTurn(ses_id,"Portfolio") portfolio = request.forms.get('portfolio') return template('Portfolio',acsrf=PriceHistoryAuth.auth.get_acsrf(ses_id),\ session_id=ses_id,\ portfolio=portfolio,\ feedback_url=LocalURLToRecordFeedback,\ footer_html=FOOTER_HTML,\ portfolio_panel=PORTFOLIO_PANEL,\ column_dropdown=COLUMN_DROPDOWN_HTML,\ mainjs_includes=MAINJS_INCLUDES,\ slickgrid_includes=SLICKGRID_INCLUDES,\ jqplot_includes=JQPLOT_INCLUDES,\ goog_anal_script=GoogleAnalyticsInclusionScript)
def profile_user(username): target_username = username own_username = request.get_cookie("account", secret=SECRET_KEY) user_data = find_user(target_username) if user_data: id = user_data['_id'] first_name = user_data['firstname'] second_name = user_data['secondname'] email = user_data['email'] target_username = user_data['username'] note = "Nothing yet" if 'note' not in user_data.keys() else user_data['note'] if own_username == target_username: return template('views/profile.tpl', id = id, first_name = first_name, second_name = second_name, email = email, username = target_username, note = note, logged = own_username or False) else: return template('views/profile_user.tpl', id = id, first_name = first_name, second_name = second_name, username = target_username, logged = own_username or False) return template ('views/error.tpl', logged=own_username or False, error_message="User with such username not found.")
def map(): return template('views/map2')
def byuser_stats(db): return template('byuser/byuser-stats', results=_users(db))
def index(): return template('index')
def lidurb(): return template('lidurb')
def lidura(): return template('lidura')
def hello(): url_encoded_keyword = request.query.keyword info(url_encoded_keyword) keyword = urldecode(url_encoded_keyword) graphJson = { "exid":[ { "name":"aoa", "link":"https://www.naver.com" } ] } graphJson = { "result":[ { "link":"http://search.naver.com/search.naver?where=nexearch&query=%EC%9D%B4%ED%96%A5&sm=top_lve&ie=utf8", "title":"%EC%9D%B4%ED%96%A5", "index":"1" }, { "link":"http://search.naver.com/search.naver?where=nexearch&query=%EC%82%B0%EB%8B%A4%EB%9D%BC%EB%B0%95&sm=top_lve&ie=utf8", "title":"%EC%82%B0%EB%8B%A4%EB%9D%BC%EB%B0%95", "index":"2" }, { "link":"http://search.naver.com/search.naver?where=nexearch&query=%EC%B2%9C%EB%91%A5&sm=top_lve&ie=utf8", "title":"%EC%B2%9C%EB%91%A5", "index":"3" }, { "link":"http://search.naver.com/search.naver?where=nexearch&query=10%EC%96%B5%EC%97%94&sm=top_lve&ie=utf8", "title":"10%EC%96%B5%EC%97%94", "index":"4" }, { "link":"http://search.naver.com/search.naver?where=nexearch&query=1%EB%B0%952%EC%9D%BC&sm=top_lve&ie=utf8", "title":"1%EB%B0%952%EC%9D%BC", "index":"5" }, { "link":"http://search.naver.com/search.naver?where=nexearch&query=%EC%A0%95%EC%9B%90%EC%8A%A4%EB%8B%98&sm=top_lve&ie=utf8", "title":"%EC%A0%95%EC%9B%90%EC%8A%A4%EB%8B%98", "index":"6" }, { "link":"http://search.naver.com/search.naver?where=nexearch&query=%EB%B3%B5%EB%A9%B4%EA%B0%80%EC%99%95&sm=top_lve&ie=utf8", "title":"%EB%B3%B5%EB%A9%B4%EA%B0%80%EC%99%95", "index":"7" }, { "link":"http://search.naver.com/search.naver?where=nexearch&query=%EC%9E%84%EC%9D%80%EC%88%98&sm=top_lve&ie=utf8", "title":"%EC%9E%84%EC%9D%80%EC%88%98", "index":"8" }, { "link":"http://search.naver.com/search.naver?where=nexearch&query=%EC%A0%95%EA%B7%9C%EC%9E%AC&sm=top_lve&ie=utf8", "title":"%EC%A0%95%EA%B7%9C%EC%9E%AC", "index":"9" }, { "link":"http://search.naver.com/search.naver?where=nexearch&query=%EC%8A%88%ED%8D%BC%EB%A7%A8%EC%9D%B4%EB%8F%8C%EC%95%84%EC%99%94%EB%8B%A4&sm=top_lve&ie=utf8", "title":"%EC%8A%88%ED%8D%BC%EB%A7%A8%EC%9D%B4%EB%8F%8C%EC%95%84%EC%99%94%EB%8B%A4", "index":"10" } ] } # debug(graphJson) return template('views/home', keyword=keyword, graph=graphJson)
def sample(): return template('views/sample')
def main(filter="response_time"): data: list = asyncio.run(get_website_analytics(urls=URLS)) sorted_data: list = sorted(data, key=lambda i: i[filter]) return template("project/views/index.tlp", data=sorted_data)
def n4wr(): return template('view/n4wr')
def index(): return template('index', freq=cli_args.freq, rate=cli_args.rate, gain=cli_args.gain, fig_file=FIG_FILE)
def download(name='XMjU3MzIxOTk2'): #name to be videoid, like XMjU3MzIxOTk2 if name.endswith(('.mp4','.flv')): name = name[0:-4] youku = YoukuVideoID2DownloadUrl() return template('<a href="{{name}}">Download</a>', name=youku.get(name))
def oldblog(year, month, filename): return template(os.path.join('static', 'oldblog', year, month, filename))
def find_country(): country = request.query['country'] data = c.find({'address.country': country}) return template('find_users.tpl', result = data)
def n5779v(): return template('view/n5779v')
def email_birthdate(): desde = request.query['from'] hasta = request.query['to'] data = c.find({'birthdate': {'$gte':desde, '$lte':hasta}}) return template('find_users.tpl', result = data)
def tpl(): return template('test')
def adm1(): return template('adm1')
def find_user(): username = request.query['username'] data = c.find({'_id':username}) return template('find_user.tpl', result = data)
def log(): return template('signlog1')
def crossdomain(): response.content_type = 'application/xml' return template('crossdomain')
def logreg(): return template('signlog1')#returning a template when the route is entered
def usr(): return template('map')
def show_fruit(): fruit = bottle.request.get_cookie("fruit") return bottle.template('fruit_selection.tpl', {'fruit': fruit})
def sign(): return template('signlog1')
def landing_category(category): print category c = Category().by_name(category) return template(c['template'], helper=Helper(category))
def index(name): return template('<b>Hello {{name}}</b>!', name=name)
def get_forcast(): lat = request.query.lat lon = request.query.lon return template('<div>Lat: {{lat}}, Lon: {{lon}} ', lat=lat, lon=lon)
def landing(): categories = Category().text_categories() c = categories[0] return template(c['template'], helper=Helper(c['name']))
def thing(thing, id): return template('Are you looking for {{object}} with identifier {{id}}', object=thing, id=id)
def index(name='Man'): return template('<div>Hello, {{person}}!</div>', person=name)