MySQL Forums
Forum List  »  Connector/Python

Django 1.10 + mysql connector 2.1.4
Posted by: matthew sadler
Date: September 10, 2016 09:06AM

I have been trying to get django 1.10 to work with mysql for a while now and i have managed to get it working with mysql connector i ran into a few issues that i have been able to figure myself.
A data timezone issue happened and i just changed this in
USE_TZ = False
I then ran into this issue:
Traceback (most recent call last):
  File "", line 22, in <module>
  File "/path/lib/python3.5/site-packages/django/core/management/", line 367, in execute_from_command_line
  File "/path/lib/python3.5/site-packages/django/core/management/", line 359, in execute
  File "/path/lib/python3.5/site-packages/django/core/management/", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/path/lib/python3.5/site-packages/django/core/management/", line 345, in execute
    output = self.handle(*args, **options)
  File "/path/lib/python3.5/site-packages/django/core/management/commands/", line 224, in handle
    self.verbosity, self.interactive, connection.alias, apps=post_migrate_apps, plan=plan,
  File "/path/lib/python3.5/site-packages/django/core/management/", line 53, in emit_post_migrate_signal
  File "/path/lib/python3.5/site-packages/django/dispatch/", line 191, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/path/lib/python3.5/site-packages/django/contrib/auth/management/", line 83, in create_permissions
  File "/path/lib/python3.5/site-packages/django/db/models/", line 452, in bulk_create
    ids = self._batched_insert(objs_without_pk, fields, batch_size)
  File "/path/lib/python3.5/site-packages/django/db/models/", line 1068, in _batched_insert
    self._insert(item, fields=fields, using=self.db)
  File "/path/lib/python3.5/site-packages/django/db/models/", line 1045, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/path/lib/python3.5/site-packages/django/db/models/sql/", line 1053, in execute_sql
    for sql, params in self.as_sql():
  File "/path/lib/python3.5/site-packages/django/db/models/sql/", line 1038, in as_sql
    result.append(self.connection.ops.bulk_insert_sql(fields, placeholder_rows))
  File "/path/lib/python3.5/site-packages/mysql/connector/django/", line 223, in bulk_insert_sql
    return "VALUES " + ", ".join([items_sql] * num_values)
TypeError: can't multiply sequence by non-int of type 'tuple'
I take it this has happened because mysql connector isn`t comp with django 1.10 atm.
Does anyone have a work around for this?

Options: ReplyQuote

Written By
Django 1.10 + mysql connector 2.1.4
September 10, 2016 09:06AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.