def guests_tr():
    try:
        rows1 = dbHandler.genre()
        rows2 = dbHandler.artist()
        return render_template('guest.html', genre=rows1, artist=rows2)
    except Exception as e:
        return str(e)
Ejemplo n.º 2
0
def main():
    try:
        if 'username' in session:
            rows1 = dbHandler.genre()
            rows2 = dbHandler.artist()
            username = session['username']
            return render_template('main.html',
                                   genre=rows1,
                                   artist=rows2,
                                   playlist=p_list)
        else:
            rows1 = dbHandler.genre()
            rows2 = dbHandler.artist()
            return render_template('guest.html', genre=rows1, artist=rows2)
    except Exception as e:
        return str(e)
def main_tr():
    try:
        if 'username' in session:
            rows1 = dbHandler.genre()
            rows2 = dbHandler.artist()
            username = session['username']
            p_list = dbHandler.playlist_names(username)
            return render_template('main.html',
                                   genre=rows1,
                                   artist=rows2,
                                   playlist=p_list)
        else:
            return redirect(url_for('guests'))
    except Exception as e:
        return str(e)