I get this error, reproducable by setting ENGINE as below in the
settings.py.
And then running the command line python manage.py startapp polls
DATABASES = {
'default': {
#'ENGINE': 'django.db.backends.mysql',
'ENGINE': 'mysql.connector.django',
The error happens at django.apps.config.py at around line 202:
self.models_module = import_module(models_module_name)
Partial stack trace (this error is reproducable anyhow.)
django.core.exceptions.ImproperlyConfigured: 'mysql.connector.django'
isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
u'base', u'mysql', u'oracle', u'postgresql_psycopg2', u'sqlite3'
Error was: cannot import name BaseDatabaseFeatures
My OS is Debian Wheezy.
--
Ticket URL: <https://code.djangoproject.com/ticket/24355>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_docs: => 0
Comment:
The connector likely hasn't been updated to be compatible with Django 1.8.
--
Ticket URL: <https://code.djangoproject.com/ticket/24355#comment:1>
Comment (by aaugustin):
To clarify — mysql-connector-python is developed independently by Oracle.
The Django team doesn't have any control over that component.
Django 1.8 is still under development. The [http://dev.mysql.com/doc
/connector-python/en/connector-python-django-backend.html documentation of
mysql-connector-python] doesn't say which versions of Django are supported
but mentions Django 1.5 a few times.
It's unclear which versions of Django mysql-connector-python supports. You
should file a bug against mysql-connector-python to support Django 1.8 and
document which versions of Django are supported.
--
Ticket URL: <https://code.djangoproject.com/ticket/24355#comment:2>
Comment (by HageMaster3108):
Disclaimer: I'm aware that this is not really a issue within the django
project, the comment below is just to point others having the same issue
into the right direction.
----
According to a MySQL bug ticket at
http://bugs.mysql.com/bug.php?id=76752#c437087
it seems that a django 1.8 capable version of mysql-connector-django
exists:
http://dev.mysql.com/downloads/connector/python/
http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-
python-2.1.3.zip
However it is unfotunately not available via pypi (see
https://pypi.python.org/pypi/mysql-connector-python).
Also when I try to install it directly via
{{{
pip install http://cdn.mysql.com/Downloads/Connector-Python/mysql-
connector-python-2.1.3.zip
}}}
It fails because the installation process tries to use a new option in
setuptools which my local version doesn't have:
{{{
Collecting http://cdn.mysql.com/Downloads/Connector-Python/mysql-
connector-python-2.1.3.zip
Downloading http://cdn.mysql.com/Downloads/Connector-Python/mysql-
connector-python-2.1.3.zip (356kB)
100% |████████████████████████████████| 356kB 7.8MB/s
Installing collected packages: mysql-connector-python
Found existing installation: mysql-connector-python 2.0.4
Uninstalling mysql-connector-python-2.0.4:
Successfully uninstalled mysql-connector-python-2.0.4
Running setup.py install for mysql-connector-python
Complete output from command /Users/patrick/.virtualenvs/ib-
cms/bin/python -c "import setuptools,
tokenize;__file__='/var/folders/s0/t3yxc5c16m32qzmwrsbtdybm0000gn/T/pip-
0EgqCn-build/setup.py';exec(compile(getattr(tokenize, 'open',
open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install
--record /var/folders/s0/t3yxc5c16m32qzmwrsbtdybm0000gn/T/pip-
5uIg95-record/install-record.txt --single-version-externally-managed
--compile --install-headers /Users/patrick/.virtualenvs/ib-
cms/include/site/python2.7/mysql-connector-python:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --single-version-externally-managed not recognized
}}}
I have stopped investigating this at this point because I'm unwilling to
update setuptools/python because that would invole quite a bit of overhead
in the environment I'm working on.
Hope this helps.
--
Ticket URL: <https://code.djangoproject.com/ticket/24355#comment:3>
Comment (by gabn88):
Thanks a bunch!
--
Ticket URL: <https://code.djangoproject.com/ticket/24355#comment:4>