jay3dec / PythonFlaskMySQLApp---Part-1

205 stars 292 forks source link

Internal Server Error #3

Open trhubwork opened 7 years ago

trhubwork commented 7 years ago

I get the following error message in my terminal when I click the submit button.

The console in dev tools reads:

jquery-1.11.2.js:9659

POST http://localhost:5002/signUp 500 (INTERNAL SERVER ERROR)send @ jquery-1.11.2.js:9659ajax @ jquery-1.11.2.js:9210(anonymous function) @ signUp.js:4dispatch @ jquery-1.11.2.js:4665elemData.handle @ jquery-1.11.2.js:4333

signUp.js:12 Object {readyState: 4, responseText: "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final/…ded or there is an error in the application.

↵", status: 500, statusText: "INTERNAL SERVER ERROR"}abort: ( statusText )always: ()complete: ()done: ()error: ()fail: ()getAllResponseHeaders: ()getResponseHeader: ( key )overrideMimeType: ( type )pipe: ( /* fnDone, fnFail, fnProgress / )progress: ()promise: ( obj )readyState: 4responseText: "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">↵500 Internal Server Error

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.

↵"setRequestHeader: ( name, value )state: ()status: 500statusCode: ( map )statusText: "INTERNAL SERVER ERROR"success: ()then: ( /
fnDone, fnFail, fnProgress */ )proto: Object

lameei commented 7 years ago

Any solutions here?

johnkatt commented 7 years ago

Has anyone been able to find the problem with this?

shpiyu commented 7 years ago

make sure you're using your own username and password in mysql's config instead of "jay" in app.py and use flaskext.mysql instead of flask.ext.mysql from flaskext.mysql import MySQL

mxsjoberg commented 7 years ago

I'm using MAMP and fixed this problem by adding,

app.config['MYSQL_DATABASE_PORT'] = 8889 app.config['MYSQL_UNIX_SOCKET'] = '/Applications/MAMP/tmp/mysql/mysql.sock'

in app.py.

mathurawasirishabh commented 7 years ago

app running fine but no change in database how to resolve this : python app.py

SanthoshAshokkumar commented 7 years ago

Try running this,

if name == "main": app.run(port=3306)

sakthi7 commented 6 years ago

hey,

i am getting the bellow ERROR, Will any one help me for fix this issue. I am struggling ...

ERROR -

[2017-12-19 04:10:57,469] ERROR in app: Exception on /signUp [POST] Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request return self.view_functionsrule.endpoint File "app.py", line 57, in signUp cursor.close() UnboundLocalError: local variable 'cursor' referenced before assignment 127.0.0.1 - - [19/Dec/2017 04:10:57] "POST /signUp HTTP/1.1" 500 -

gnany07 commented 5 years ago

sakthi7 from the error i feel that,you did not assign the cursor variable.did you do 'cursor =conn.cursor()'.Please check