python - Internal Server error. Flask -
i running script while , seems give me error.
@app.route('/') def hello(): return ''' <form method="post" action="/people"> <font size = "4">i looking for?</font><br> <font size = 2>please enter atleast 2 words. </font><br><br> <input name="search" type="text" width=1000px> <br> <input type="submit" value="people search"/> <br> </form> <form method="post" action="/science"> <input name="search" type="text" width=1000px> <input type="submit" value="science search"/> </form>''' @app.route('/people', methods=['post']) def peoplesearch(): name = request.form.get('search') print (name)
it gives internal server error on clicking peoplesearch. working while back.
you not return response peoplesearch
endpoint. next code must work fine:
@app.route('/people', methods=['post']) def people_search(): name = request.form.get('search') return name
Comments
Post a Comment