There is an error in ' Custom recipe generator '

Hi @bhavsarrudra342,

Here’s the corrected version of your code:

from flask import Flask, request

app = Flask('__name__')

@app.route('/', methods=['GET', 'POST'])
def hello(): 
    output = ""

    if request.method == 'POST':
        components = request.form['components']
        output = generate_tutorial(components)
    

    return output

@app.route('/generate', methods=['POST'])
def generate():
    components = request.form['components']
    return generate_tutorial(components)

if `__name__` == '__main__':
    app.run(host='0.0.0.0', port=8080)

@bhavsarrudra342 Line 106 in your code is incorrect. You must write name with a double underscore on either side.
The corrected code looks like this
image

1 Like