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__':'', 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

1 Like