title: Django - (1366, "Incorrect string value:... error
body: <p>I am getting the following error when I try to add a new record via <code>django</code> admin:</p>
  
  <blockquote>
    <p>OperationalError at /admin/competition/sport/add/
    (1366, "Incorrect string value: '\xC4\x9F\xC3\xBC' for column 'object_repr' at row 1")
    Request Method: POST
    Request URL:    <a href="http://127.0.0.1:8000/admin/competition/sport/add/" rel="noreferrer">http://127.0.0.1:8000/admin/competition/sport/add/</a>
    Django Version: 1.11.4
    Exception Type: OperationalError
    Exception Value:<br>
    (1366, "Incorrect string value: '\xC4\x9F\xC3\xBC' for column 'object_repr' at row 1")</p>
  </blockquote>
  
  <p>Here is the model:</p>
  
  <pre><code>class Sport(models.Model):
      is_team = models.BooleanField(_("Is Team"))
      name = models.CharField(_("Name"), max_length=200)
  </code></pre>
  
  <p>And options for <code>mysql</code> backend at my <code>settings.py</code>:</p>
  
  <pre><code>'OPTIONS': {
          'charset': 'utf8mb4',
          'init_command': 'SET character_set_connection=utf8mb4;'
                          'SET collation_connection=utf8mb4_unicode_ci;'
                          "SET NAMES 'utf8mb4';"
                          "SET CHARACTER SET utf8mb4;"
      },
  </code></pre>
  
  <p>I have updated all of the tables and columns to use <code>utf8mb4</code> as described <a href="https://mathiasbynens.be/notes/mysql-utf8mb4#character-sets" rel="noreferrer">here</a></p>
  
  <p>Nothing has worked so far. I get no error when I try to insert a record that contains unicode characters using <code>mysql</code> shell, but the <code>django</code> admin gives the error above.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Interestingly the code below works perfectly when i try to insert a record manually:</p>
  
  <pre><code>Sport(is_team=True, name="ÜĞüiğÇÖ").save()
  </code></pre>
  
  <p><strong>EDIT 2:</strong> </p>
  
  <p>I finally figured what causes the problem. Django admin logs every action by default (including the data, in my case it was some weird unicode text). It turns out 'django_admin_log' table has 'latin1' charset, so i simply converted it into utf8:</p>
  
  <pre><code>ALTER TABLE django_admin_log CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
  </code></pre>
  
  <p>Then everything worked fine.</p>