Quiero hacer funcionar mysql en Django y python 3.3. Por ahora he hecho esto:
Instalar python 3.3, instalar Django e instalar mysql-connector-python-1.1.6-py3.3.msi de esta página https://dev.mysql.com/downloads/connector/python/
luego voy a Django y en settings.py pongo esto en database
Código:
cuando intento ejecutar Django con el comando manage.py runserverDATABASES = { 'default': { 'NAME': 'nombrebasededatos', 'ENGINE': 'mysql.connector.django', 'USER': 'usuario', 'PASSWORD': 'pass', 'OPTIONS': { 'autocommit': True, }, } }
Tengo este error:
Código:
Y de ahí ya no veo la solución para seguir adelante, no veo mucha información al respecto. C:\workspaces\django_creditor>manage.py runserver Validating models... Unhandled exception in thread started by <bound method Command.inner_run of <dja ngo.contrib.staticfiles.management.commands.runserver.Command object at 0x000000 000313D780>> Traceback (most recent call last): File "C:\Python33\lib\site-packages\django\core\management\commands\runserver. py", line 93, in inner_run self.validate(display_num_errors=True) File "C:\Python33\lib\site-packages\django\core\management\base.py", line 280, in validate num_errors = get_validation_errors(s, app) File "C:\Python33\lib\site-packages\django\core\management\validation.py", lin e 28, in get_validation_errors from django.db import models, connection File "C:\Python33\lib\site-packages\django\db\__init__.py", line 40, in <modul e> backend = load_backend(connection.settings_dict['ENGINE']) File "C:\Python33\lib\site-packages\django\db\__init__.py", line 34, in __geta ttr__ return getattr(connections[DEFAULT_DB_ALIAS], item) File "C:\Python33\lib\site-packages\django\db\utils.py", line 94, in __getitem __ conn = backend.DatabaseWrapper(db, alias) File "C:\Python33\lib\site-packages\mysql\connector\django\base.py", line 471, in __init__ self._connect() File "C:\Python33\lib\site-packages\mysql\connector\django\base.py", line 542, in _connect self.init_connection_state() File "C:\Python33\lib\site-packages\mysql\connector\django\base.py", line 531, in init_connection_state if self.settings_dict['AUTOCOMMIT']: KeyError: 'AUTOCOMMIT' Exception ResourceWarning: ResourceWarning('unclosed <socket.socket object, fd=3 48, family=2, type=1, proto=6>',) in <socket.socket object, fd=348, family=2, ty pe=1, proto=6> ignored