Exemple #1
0
def submit():
    url = request.form['url']

    i = lib.pyTurl()
    key = i.keygen(8)
    i.addentry(key,url)

    q = lib.pyTurl()
    fqr = q.qrgen(url)
    
    d = lib.pyTurl()
    qr = d.getqr(fqr)

    return render_template('submit.html', title="PyTurl: Record", url=url, key=request.url_root+key, qr=qr)
Exemple #2
0
def submit():
    url = request.form['url']

    i = lib.pyTurl()
    key = i.keygen(8)
    i.addentry(key, url)

    q = lib.pyTurl()
    fqr = q.qrgen(url)

    d = lib.pyTurl()
    qr = d.getqr(fqr)

    return render_template('submit.html',
                           title="PyTurl: Record",
                           url=url,
                           key=request.url_root + key,
                           qr=qr)
Exemple #3
0
def redirection(key):
    """ P """
    #On cherche la clé dans la db

    i = lib.pyTurl()
    url = i.readentry(key)

    if url:
        return redirect(url[0][0])
    else:
        return index(msg=u"L'url demandé n'existe pas!")
Exemple #4
0
def redirection(key):
    """ P """
    #On cherche la clé dans la db

    i = lib.pyTurl()
    url = i.readentry(key)

    if url:
        return redirect(url[0][0])
    else:
        return index(msg=u"L'url demandé n'existe pas!")