+ 3

what is the error?

I am working on a server using flask but there are some errors coming that I can't understand Console: [2017-12-16 15:47:31,096] ERROR in app: Exception on /usr [POST] Traceback (most recent call last): File "C:\Users\Home\AppData\Local\Programs\Python\Python36-32\lib\site-packages\flask\app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "C:\Users\Home\AppData\Local\Programs\Python\Python36-32\lib\site-packages\flask\app.py", line 1615, in full_dispatch_request return self.finalize_request(rv) File "C:\Users\Home\AppData\Local\Programs\Python\Python36-32\lib\site-packages\flask\app.py", line 1630, in finalize_request response = self.make_response(rv) File "C:\Users\Home\AppData\Local\Programs\Python\Python36-32\lib\site-packages\flask\app.py", line 1725, in make_response raise ValueError('View function did not return a response') ValueError: View function did not return a response 127.0.0.1 - - [16/Dec/2017 15:47:31] "POST /usr HTTP/1.1" 500 - server.py: from flask import * from ai import * app=Flask(__name__) a=AI() @app.route('/') def hello(): return '<h1>Hello human, what is your name?</h1>' @app.route('/usr',methods=['POST','GET']) def usr(): if request.method=='POST': return a.run(request.form['nm']) else: return a.run(request.args.get('nm')) app.run(port='4357') index.html: <html> <head> <title>Server</title> </head> <body> <form action="http://localhost:4357/usr" method="post"> <p>>>></p><p><input type="text" name="nm" /></p> <p><input type="submit" value="submit" /></p> </form> </body> </html> On IE(the html page on IE): >>> ________ |hi | ________ __________ [Submit ] __________ All the errors come after clicking submit

16th Dec 2017, 10:26 AM
Prabhakar Dev
Prabhakar Dev - avatar
1 Réponse
0
I m not sure but it might be with your , action value
16th Dec 2017, 12:33 PM
Morpheus
Morpheus - avatar