@app.route('/blogs/new/', methods=['GET', 'POST'])
def create_new_blog():
    if (request.method == 'GET'):
        return render_template('new_blog.html')
    else:
        title = request.form['title']
        description = request.form['description']
        user = User.get_by_email(session['email'])
        new_blog = Blog(user.email, title, description, user._id)
        new_blog.save_to_mongo()
        return make_response(blog_posts(user._id))
@app.route('/blogs/new/', methods=['GET', 'POST'])
def create_new_blog():
    if (request.method == 'GET'):
        return render_template('new_blog.html')
    else:
        title = request.form['title']
        description = request.form['description']
        user = User.get_by_email(session['email'])
        new_blog = Blog(user.email, title, description, user._id)
        new_blog.save_to_mongo()
        return make_response(blog_posts(user._id))