405: Method Not Allowed. Why am I getting this error in Flask

Solution 1
@app.route("/add_cars", methods=['GET', 'POST'])
def add_ev():
    # add ev's
    ...
Solution 2
@app.route("/add_cars", methods=['GET','POST'])
def add_ev():
    ...
    if request.method == 'POST':
        return redirect(url_for("add_ev"))
    elif request.method == 'GET':
        return render_template('add_cars.html')