Question: NEED HELP!!! DON'T UNDERSTAND WHAT I'M BEING ASKED TO DO AT THIS POINT To process the form, define a new function encrypt in main.py. Add

NEED HELP!!!

DON'T UNDERSTAND WHAT I'M BEING ASKED TO DO AT THIS POINT

To process the form, define a new function encrypt in main.py. Add an @app.route decorator to configure the function to receive requests at the root path "/", and with methods=['POST'].

When the form is submitted, the request will contain the parameters rot and text. In order to access these, we need Flask's request object. To import it, modify the topmost import statement to include this object.

from flask import Flask, request

Within encrypt, store the values of these request parameters in local variables, converting data types as necessary. Then, encrypt the value of the text parameter using rotate_string. Return the encrypted string wrapped in

tags, to be rendered in the browser.

MY CODE SO FAR

from flask import Flask, request

from caesar import rotate_string

app = Flask(__name__)

app.config['DEBUG'] = True

form= """

Rotate by:

"""

@app.route("/")

def index():

return form

app.run()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!