I have a simple model that when I try to save, I can see this exception in the PyDev output while debugging my Django app.
I've confirmed all fields are being set to their proper values (this is a model with 5 charfield/integer properties). I've stepped through in eclipse to the line that is calling .save(), which is where the exception is thrown. I've tried every variation, confirmed the mysql credentials in settings.py are correct. I cannot find a solution, or a meaningful error to me.
The handler is equivalent to this, as I've chopped it down to the most minimal thing for testing:
def dosomething(request):
myModel = SomeModel()
myModel.field1 = "somestring"
myModel.save()
return HttpResponse("success")
38. myModel.save() File "C:\Python26\lib\site-packages\django\db\models\base.py" in save 434. self.save_base(using=using, force_insert=force_insert, force_update=force_update) File "C:\Python26\lib\site-packages\django\db\models\base.py" in save_base 527. result = manager._insert(values, return_id=update_pk, using=using) File "C:\Python26\lib\site-packages\django\db\models\manager.py" in _insert 195. return insert_query(self.model, values, **kwargs) File "C:\Python26\lib\site-packages\django\db\models\query.py" in insert_query 1479. return query.get_compiler(using=using).execute_sql(return_id) File "C:\Python26\lib\site-packages\django\db\models\sql\compiler.py" in execute_sql 783. cursor = super(SQLInsertCompiler, self).execute_sql(None) File "C:\Python26\lib\site-packages\django\db\models\sql\compiler.py" in execute_sql 727. cursor.execute(sql, params) File "C:\Python26\lib\site-packages\django\db\backends\util.py" in execute 15. return self.cursor.execute(sql, params) File "C:\Python26\lib\site-packages\django\db\backends\mysql\base.py" in execute 86. return self.cursor.execute(query, args) File "C:\Python26\lib\site-packages\MySQLdb\cursors.py" in execute 173. self.errorhandler(self, exc, value) File "C:\Python26\lib\site-packages\MySQLdb\connections.py" in defaulterrorhandler 36. raise errorclass, errorvalue Exception Type: DatabaseError at /api/v1/test
This exception is on my more complex model, still following a very basic schema:
Exception happened during processing of request from ('127.0.0.1', 50047)
Traceback (most recent call last):
File "C:\Python26\lib\SocketServer.py", line 283, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Python26\lib\SocketServer.py", line 309, in process_request
self.finish_request(request, client_address)
File "C:\Python26\lib\SocketServer.py", line 322, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python26\lib\site-packages\django\core\servers\basehttp.py", line 562, in __init__
BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
File "C:\Python26\lib\SocketServer.py", line 618, in __init__
self.finish()
File "C:\Python26\lib\SocketServer.py", line 661, in finish
self.wfile.flush()
File "C:\Python26\lib\socket.py", line 297, in flush
self._sock.sendall(buffer(data, write_offset, buffer_size))
error: [Errno 10053] An established connection was aborted by the software in your host machine