error when giving mysql as the database (engine) in Django - django

In my web application which is being made in Django (Django==3.2), I am trying to use mysql as the Database, but in the settings.py, when I tried to give mysql as the engine :
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': DB_NAME,
'HOST': DB_HOST,
'USER': DB_HOST,
'PASSWORD': DB_PASS
}
}
and then tried ruserver command, I got the following error:
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/db/utils.py", line 111, in load_backend
return import_module('%s.base' % backend_name)
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'django.db.backends.mysql'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 110, in inner_run
autoreload.raise_last_exception()
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/utils/autoreload.py", line 87, in raise_last_exception
raise _exception[1]
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
autoreload.check_errors(django.setup)()
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/apps/config.py", line 301, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/contrib/auth/models.py", line 3, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/contrib/auth/base_user.py", line 48, in <module>
class AbstractBaseUser(models.Model):
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/db/models/base.py", line 122, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/db/models/base.py", line 326, in add_to_class
value.contribute_to_class(cls, name)
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/db/models/options.py", line 207, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/utils/connection.py", line 15, in __getattr__
return getattr(self._connections[self._alias], item)
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/utils/connection.py", line 62, in __getitem__
conn = self.create_connection(alias)
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/db/utils.py", line 204, in create_connection
backend = load_backend(db['ENGINE'])
File "/home/john/PycharmProjects/social_network/venv/lib/python3.6/site-packages/django/db/utils.py", line 128, in load_backend
) from e_user
django.core.exceptions.ImproperlyConfigured: 'django.db.backends.mysql' isn't an available database backend or couldn't be imported. Check the above exception. To use one of the built-in backends, use 'django.db.backends.XXX', where XXX is one of:
'oracle', 'postgresql', 'sqlite3'
do you know how I can give mysql as the engine in the settings.py? I tried the following but got the same error:
mysql.connector.django

try to install : (mysqlclient) pip install mysqlclient in order to use MYSQL as the backend for Django apps ; you will need the mysqlclient library and in your settings.py file do this :
#settings.py
DATABASES = {
'default' : {
'ENGINE': 'django.db.backends.mysql',
'NAME' : 'mydatabase',
'USER' : 'myUser',
'PASSWORD' : 'My_passowrd',
'HOST' : 'localhost',
'PORT' : '' ,
}
}
i hope it helped you

Related

running django project on a other machine, giving error

I would like to run my django project on a other machine.
When running python3 manage.py runserver i get the error:
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/usr/lib/python3.9/threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/django/utils/autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "/usr/lib/python3/dist-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/usr/lib/python3/dist-packages/django/utils/autoreload.py", line 77, in raise_last_exception
raise _exception[1]
File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 337, in execute
autoreload.check_errors(django.setup)()
File "/usr/lib/python3/dist-packages/django/utils/autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "/usr/lib/python3/dist-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/lib/python3/dist-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/usr/lib/python3/dist-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/usr/lib/python3/dist-packages/django/contrib/auth/models.py", line 2, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "/usr/lib/python3/dist-packages/django/contrib/auth/base_user.py", line 47, in <module>
class AbstractBaseUser(models.Model):
File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 117, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 321, in add_to_class
value.contribute_to_class(cls, name)
File "/usr/lib/python3/dist-packages/django/db/models/options.py", line 204, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "/usr/lib/python3/dist-packages/django/db/__init__.py", line 28, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/usr/lib/python3/dist-packages/django/db/utils.py", line 202, in __getitem__
conn = backend.DatabaseWrapper(db, alias)
File "/homes/bvink/.local/lib/python3.9/site-packages/mysql/connector/django/base.py", line 336, in __init__
super(DatabaseWrapper, self).__init__(*args, **kwargs)
File "/usr/lib/python3/dist-packages/django/db/backends/base/base.py", line 102, in __init__
self.client = self.client_class(self)
TypeError: 'NoneType' object is not callable
I can access mysql on the this 'other' machine.
Can someone help me get the project running?
EDIT:
my database section in settings.py
DATABASES = {
'default': {
'ENGINE': 'mysql.connector.django',
'NAME': 'Bvink',
'USER': 'bvink',
'PASSWORD': 'XXXXX',
'HOST': 'mariadb',
'PORT': '3306',
}
}
I also get this error when i type python3 manage.py makemigrations, migrate and shell

Cant run django server because of cx_oracle

i pull my friend code in github , and when i want to run it with django
*path*>workon test
(test)*path*>py manage.py runserver
Here is the error I got
Traceback (most recent call last):
File "C:\Users\u532246\Envs\test\lib\site-packages\django\db\backends\oracle\base.py", line 47, in <module>
import cx_Oracle as Database
ModuleNotFoundError: No module named 'cx_Oracle'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\u532246\appdata\local\programs\python\python38-32\Lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "c:\users\u532246\appdata\local\programs\python\python38-32\Lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\u532246\Envs\test\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\u532246\Envs\test\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "C:\Users\u532246\Envs\test\lib\site-packages\django\utils\autoreload.py", line 77, in raise_last_exception
raise _exception[1]
File "C:\Users\u532246\Envs\test\lib\site-packages\django\core\management\__init__.py", line 337, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\u532246\Envs\test\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\u532246\Envs\test\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\u532246\Envs\test\lib\site-packages\django\apps\registry.py", line 114, in populate
app_config.import_models()
File "C:\Users\u532246\Envs\test\lib\site-packages\django\apps\config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "C:\Users\u532246\Envs\test\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\u532246\Desktop\skripsi\Django-master\polls\models.py", line 6, in <module>
class Question(models.Model):
File "C:\Users\u532246\Envs\test\lib\site-packages\django\db\models\base.py", line 117, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "C:\Users\u532246\Envs\test\lib\site-packages\django\db\models\base.py", line 321, in add_to_class
value.contribute_to_class(cls, name)
File "C:\Users\u532246\Envs\test\lib\site-packages\django\db\models\options.py", line 204, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "C:\Users\u532246\Envs\test\lib\site-packages\django\db\__init__.py", line 28, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "C:\Users\u532246\Envs\test\lib\site-packages\django\db\utils.py", line 201, in __getitem__
backend = load_backend(db['ENGINE'])
File "C:\Users\u532246\Envs\test\lib\site-packages\django\db\utils.py", line 110, in load_backend
return import_module('%s.base' % backend_name)
File "C:\Users\u532246\Envs\test\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\u532246\Envs\test\lib\site-packages\django\db\backends\oracle\base.py", line 49, in <module>
raise ImproperlyConfigured("Error loading cx_Oracle module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading cx_Oracle module: No module named 'cx_Oracle'
I already put the oracle modulein advance system setting , but its still not working , i wonder if i put the wrong file or not there is something i havent set to make it work
Already find the solution :
Check if your python has the same bit with cx_oracle , perhaps cx_oracle will be installed the same bit like your OS has .
if it didnt have the same bit , you must download the python the same bit like your OS does , if it is 64 bit then your python must 64 bit

Syntax error while saving postgresql server info in setting.py Django

I am getting Syntax error while saving postgresql server information in setting.py file of Django and running server. Below are the settings i am saving in setting.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'webportal',
'USER': 'postgres',
'PASSWORD': 'password'
'HOST':'localhost',
'PORT' : '5432',
}
}
and the error is :-
\Django_Project\project2\WebPortal-Project>manage.py runserver
Traceback (most recent call last):
File "C:\Users\AJ!!\Dropbox\Django_Project\project2\WebPortal-Project\manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\AJ!!\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py", line 371, in execute_from_command_line
utility.execute()
File "C:\Users\AJ!!\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py", line 317, in execute
settings.INSTALLED_APPS
File "C:\Users\AJ!!\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\conf\__init__.py", line 56, in __getattr__
self._setup(name)
File "C:\Users\AJ!!\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\conf\__init__.py", line 43, in _setup
self._wrapped = Settings(settings_module)
File "C:\Users\AJ!!\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\conf\__init__.py", line 106, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "C:\Users\AJ!!\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 674, in exec_module
File "<frozen importlib._bootstrap_external>", line 781, in get_code
File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "C:\Users\AJ!!\Dropbox\Django_Project\project2\WebPortal-Project\WebPortal\settings.py", line 83
'HOST':'localhost',
^
SyntaxError: invalid syntax
Could you please help me figure out what is this syntax error appears.
You are missing a comma after the 'PASSWORD': 'password' line.

postgis dont work with django

this in setting.py
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME':'agricom',
'USER':'postgres',
'HOST':'localhost',
'PASSWORD':'put',
'PORT':'5433',
}
}
The above exception was the direct cause of the following exception:
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/Users/amerah/tutorial_geodjango/lifelngls/lib/python3.6/site-
packages/django/core/management/__init__.py", line 371, in
execute_from_command_line
utility.execute()
File "/Users/amerah/tutorial_geodjango/lifelngls/lib/python3.6/site-
packages/django/core/management/__init__.py", line 347, in execute
django.setup()
File "/Users/amerah/tutorial_geodjango/lifelngls/lib/python3.6/site-
packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/amerah/tutorial_geodjango/lifelngls/lib/python3.6/site-
packages/django/apps/registry.py", line 112, in populate
app_config.import_models()
File "/Users/amerah/tutorial_geodjango/lifelngls/lib/python3.6/site-
packages/django/apps/config.py", line 198, in import_models
self.models_module = import_module(models_module_name)
File
here complete000of exception was the apper so see it under this line :
"/Users/amerah/tutorial_geodjango/lifelngls/lib/python3.6/
importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _
find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in
_call_with_frames_removed
File "/Users/amerah/tutorial_geodjango/lifelngls/lib/python3.6/site-
packages/django/contrib/auth/models.py", line 2, in <module>
from django.contrib.auth.base_user import AbstractBaseUser,
BaseUserManager
File "/Users/amerah/tutorial_geodjango/lifelngls/lib/python3.6/site-
packages/django/contrib/auth/base_user.py", line 47, in <module>
class AbstractBaseUser(models.Model):
File "/Users/amerah/tutorial_geodjango/lifelngls/lib/python3.6/site-
packages/django/db/models/base.py", line 114, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "/Users/amerah/tutorial_geodjango/lifelngls/lib/python3.6/site-
packages/django/db/models/base.py", line 315, in add_to_class
value.contribute_to_class(cls, name)
File "/Users/amerah/tutorial_geodjango/lifelngls/lib/python3.6/site-
packages/django/db/models/options.py", line 205, in contribute_to_class
self.db_table = truncate_name(self.db_table,
connection.ops.max_name_length())
File "/Users/amerah/tutorial_geodjango/lifelngls/lib/python3.6/site-
packages/django/db/__init__.py", line 33, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/Users/amerah/tutorial_geodjango/lifelngls/lib/python3.6/site-
packages/django/db/utils.py", line 202, in __getitem__
backend = load_backend(db['ENGINE'])
File "/Users/amerah/tutorial_geodjango/lifelngls/lib/python3.6/site-
packages/django/db/utils.py", line 125, in load_backend
) from e_user
here complete000of exception was the apper so see it under this line :
django.core.exceptions.ImproperlyConfigured:
'django.contrib.gis.db.backends.postgis' isn't an available database
backend.
Try using 'django.db.backends.XXX', where XXX is one of:
'mysql', 'oracle', 'sqlite3'

How does one get Oracle's Python MySQL driver to work with django 1.11?

I installed on ubuntu 16.04 django 1.11 using pip3 and then installed the oracle mysql-connector-python. Why is this error occurring? How can I resolve it? According to the tutorial migrations will run even if there are no models defined.
Installed by using pip3
pip3 install --egg http://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-2.1.6.zip
My database configuration
DATABASES = {
'default': {
'NAME': 'user_data',
'ENGINE': 'mysql.connector.django',
'USER': 'mysql_user',
'PASSWORD': 'priv4te',
'OPTIONS': {
'autocommit': True,
},
}
}
The command that I ran
python3 /home/django/workspace/mysite/manage.py migrate
The Error
Traceback (most recent call last):
File "/home/django/workspace/mysite/manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/home/django/.local/lib/python3.5/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/home/django/.local/lib/python3.5/site-packages/django/core/management/__init__.py", line 337, in execute
django.setup()
File "/home/django/.local/lib/python3.5/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/django/.local/lib/python3.5/site-packages/django/apps/registry.py", line 108, in populate
app_config.import_models()
File "/home/django/.local/lib/python3.5/site-packages/django/apps/config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 665, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/django/.local/lib/python3.5/site-packages/django/contrib/auth/models.py", line 4, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "/home/django/.local/lib/python3.5/site-packages/django/contrib/auth/base_user.py", line 52, in <module>
class AbstractBaseUser(models.Model):
File "/home/django/.local/lib/python3.5/site-packages/django/db/models/base.py", line 124, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "/home/django/.local/lib/python3.5/site-packages/django/db/models/base.py", line 330, in add_to_class
value.contribute_to_class(cls, name)
File "/home/django/.local/lib/python3.5/site-packages/django/db/models/options.py", line 214, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "/home/django/.local/lib/python3.5/site-packages/django/db/__init__.py", line 33, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/home/django/.local/lib/python3.5/site-packages/django/db/utils.py", line 212, in __getitem__
conn = backend.DatabaseWrapper(db, alias)
File "/home/django/.local/lib/python3.5/site-packages/mysql/connector/django/base.py", line 336, in __init__
super(DatabaseWrapper, self).__init__(*args, **kwargs)
File "/home/django/.local/lib/python3.5/site-packages/django/db/backends/base/base.py", line 96, in __init__
self.client = self.client_class(self)
TypeError: 'NoneType' object is not callable
Finished "/home/django/workspace/mysite/manage.py migrate" execution.
Found this question as I'm having the same issue. There is apparently a known bug.
https://bugs.mysql.com/bug.php?id=86105