Description
I get the following error message in my terminal when I click the submit button.
- Running on http://127.0.0.1:5002/ (Press CTRL+C to quit)
127.0.0.1 - - [29/Sep/2016 15:53:10] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [29/Sep/2016 15:53:13] "GET /showSignUp HTTP/1.1" 200 -
127.0.0.1 - - [29/Sep/2016 15:53:14] "GET /static/css/signup.css HTTP/1.1" 200 -
127.0.0.1 - - [29/Sep/2016 15:53:14] "GET /static/js/jquery-1.11.2.js HTTP/1.1" 200 -
127.0.0.1 - - [29/Sep/2016 15:53:14] "GET /static/js/signUp.js HTTP/1.1" 200 -
[2016-09-29 15:53:19,759] ERROR in app: Exception on /signUp [POST]
Traceback (most recent call last):
File "C:\Users\TR\AppData\Local\Programs\Python\Python35-32\lib\site-packages\flask\app.py", line 1988, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\TR\AppData\Local\Programs\Python\Python35-32\lib\site-packages\flask\app.py", line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\TR\AppData\Local\Programs\Python\Python35-32\lib\site-packages\flask\app.py", line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\TR\AppData\Local\Programs\Python\Python35-32\lib\site-packages\flask_compat.py", line 33, in reraise
raise value
File "C:\Users\TR\AppData\Local\Programs\Python\Python35-32\lib\site-packages\flask\app.py", line 1639, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\TR\AppData\Local\Programs\Python\Python35-32\lib\site-packages\flask\app.py", line 1625, in dispatch_request
return self.view_functionsrule.endpoint
File "app.py", line 54, in signUp
cursor.close()
UnboundLocalError: local variable 'cursor' referenced before assignment
127.0.0.1 - - [29/Sep/2016 15:53:19] "POST /signUp HTTP/1.1" 500 -
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: "↵", 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: "↵<title>500 Internal Server Error</title>↵
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