0

The error details:

Warning at /admin/cute/cute/
Incorrect string value: '\xF0\x9F\x98\x89\xE7\x93...' for column 'object_repr' at row 1
Request Method: POST
Request URL:    http://api.ourcute.com/admin/cute/cute/?recommend__exact=0
Django Version: 1.7.1
Exception Type: Warning
Exception Value:    
Incorrect string value: '\xF0\x9F\x98\x89\xE7\x93...' for column 'object_repr' at row 1
Exception Location: /usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py in _warning_check, line 117
Python Executable:  /usr/local/bin/uwsgi
Python Version: 2.7.3
Python Path:    
['/opt/cute_project/server/server/',
 '/opt/cute_project/server/uwsgi/',
 '/opt/cute_project/server/',
 '.',
 '/opt/cute_project/server',
 '/opt/cute_project/server/server/src/django-cache-machine',
 '/usr/local/lib/python2.7/dist-packages/oss-0.1.3-py2.7.egg',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages']
Server time:    星期日, 22 二月 2015 06:34:27 +0800

The error is located in a django admin page, which is generated by admin template. So I guess it should be mysql setting error.

markwalker_
  • 12,078
  • 7
  • 62
  • 99
sky
  • 1
  • 1
  • What are you trying to save to the database, Asian characters? I'm guessing this will come down to the encoding setup of the db because if it's coming through django admin it should be setup for foreign characters. http://stackoverflow.com/questions/10957238/incorrect-string-value-when-trying-to-insert-utf-8-into-mysql-via-jdbc – markwalker_ Feb 21 '15 at 22:58

1 Answers1

0

If that is a 4-byte "winking face" in utf8, you need to change from utf8 to utf8mb4 in MySQL.

Rick James
  • 135,179
  • 13
  • 127
  • 222