Example #1
0
 def GET(self, key):
     r = Redis(connection_pool=redis_pool)
     url = r.hget(URL_HASH_NAME, key)
     if url:
         r.hincrby(COUNT_HASH_NAME, key)
         raise web.seeother(url)
     else:
         raise notfound()
Example #2
0
    def GET(self, key):
        r = Redis(connection_pool=redis_pool)

        user_id = check_token(r)

        url = r.hget(URL_HASH_NAME, key)
        if url:
            count = r.hget(COUNT_HASH_NAME, key)

            return render_template('details.html',
                user_id=user_id,
                key=key,
                url=url,
                count=count,
                section_class='index'
            )
        else:
            raise notfound()
Example #3
0
 def GET(self):
     raise notfound()