X-Received: by 10.42.49.138 with SMTP id w10mr7097392icf.13.1404468958312; Fri, 04 Jul 2014 03:15:58 -0700 (PDT) X-Received: by 10.50.18.50 with SMTP id t18mr347061igd.10.1404468958193; Fri, 04 Jul 2014 03:15:58 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!hn18no2896813igb.0!news-out.google.com!bp9ni2744igb.0!nntp.google.com!uq10no1441480igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.python Date: Fri, 4 Jul 2014 03:15:57 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=125.227.248.66; posting-account=pJ7uNAoAAAAHwdz2gtW7xXFmZBh0Iyco NNTP-Posting-Host: 125.227.248.66 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: flask sql cann't insert Variable in VALUES From: Frank Liou Injection-Date: Fri, 04 Jul 2014 10:15:58 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.python:73945 I try to insert username in to my table it show Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. it maybe mean no request i try to change username to '123123' then it works.... what's problem with this? @app.route('/user/',methods=['GET','POST']) def hello(username): if request.method=='POST': save_friends(username) return username def save_friends(username): conn = engine.connect() conn.execute("INSERT INTO friends(name) VALUES(username)")