@app.route('/blogs/<string:user_id>')
@app.route('/blogs')
def user_blogs(user_id=None):
    blogs = None
    user = None
    if (user_id is not None):
        user = User.get_by_id(user_id)
    elif (session['email'] is not None):
        user = User.get_by_email(session['email'])
        blogs = user.get_blogs()
    return render_template('user_blogs.html', blogs=blogs, email=user.email)
@app.route('/blogs/<string:user_id>')
@app.route('/blogs')
def user_blogs(user_id=None):
    blogs = None
    user = None
    if (user_id is not None):
        user = User.get_by_id(user_id)
    elif (session['email'] is not None):
        user = User.get_by_email(session['email'])
        blogs = user.get_blogs()
    return render_template('user_blogs.html', blogs=blogs, email=user.email)