Django 1.6 + Mysql

54 views
Skip to first unread message

Henrique Oliveira

unread,
Jul 5, 2014, 8:03:56 PM7/5/14
to django...@googlegroups.com
hi there,

I am getting this error when using Mysql connector:

File "/opt/b360/lib/python3.4/site-packages/django/core/handlers/base.py", line 114, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/opt/b360/lib/python3.4/site-packages/django/views/generic/base.py", line 69, in view
    return self.dispatch(request, *args, **kwargs)

  File "/opt/b360/lib/python3.4/site-packages/django/views/generic/base.py", line 87, in dispatch
    return handler(request, *args, **kwargs)

  File "/opt/b360/lib/python3.4/site-packages/allauth/account/views.py", line 194, in get
    self.object = self.get_object()

  File "/opt/b360/lib/python3.4/site-packages/allauth/account/views.py", line 258, in get_object
    return queryset.get(key=self.kwargs["key"].lower())

  File "/opt/b360/lib/python3.4/site-packages/django/db/models/query.py", line 301, in get
    num = len(clone)

  File "/opt/b360/lib/python3.4/site-packages/django/db/models/query.py", line 77, in __len__
    self._fetch_all()

  File "/opt/b360/lib/python3.4/site-packages/django/db/models/query.py", line 854, in _fetch_all
    self._result_cache = list(self.iterator())

  File "/opt/b360/lib/python3.4/site-packages/django/db/models/query.py", line 220, in iterator
    for row in compiler.results_iter():

  File "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/compiler.py", line 709, in results_iter
    for rows in self.execute_sql(MULTI):

  File "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/compiler.py", line 772, in execute_sql
    sql, params = self.as_sql()

  File "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/compiler.py", line 93, in as_sql
    where, w_params = self.query.where.as_sql(qn=qn, connection=self.connection)

  File "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/where.py", line 103, in as_sql
    sql, params = child.as_sql(qn=qn, connection=connection)

  File "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/where.py", line 106, in as_sql
    sql, params = self.make_atom(child, qn, connection)

  File "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/where.py", line 181, in make_atom
    lvalue, params = lvalue.process(lookup_type, params_or_value, connection)

  File "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/where.py", line 365, in process
    connection=connection, prepared=True)

  File "/opt/b360/lib/python3.4/site-packages/django/db/models/fields/__init__.py", line 407, in get_db_prep_lookup
    prepared=prepared)]

  File "/opt/b360/lib/python3.4/site-packages/django/db/models/fields/__init__.py", line 912, in get_db_prep_value
    return connection.ops.value_to_db_datetime(value)

  File "/opt/b360/lib/python3.4/site-packages/mysql/connector/django/base.py", line 398, in value_to_db_datetime
    return self.connection.connection.converter._datetime_to_mysql(value)

AttributeError: 'NoneType' object has no attribute 'converter'

Any Ideas?

Dean

unread,
Jul 5, 2014, 9:48:35 PM7/5/14
to django...@googlegroups.com
The first place I look is in the last line of the error message. I don't think you have a MySQL connection, check in your error log file.

Henrique Oliveira

unread,
Jul 5, 2014, 11:37:37 PM7/5/14
to django...@googlegroups.com
Hi Dean,

I have a MySQL connection because I can log in.

Carlos Arturo Sanchez Rivera

unread,
Jul 7, 2014, 11:12:31 AM7/7/14
to django...@googlegroups.com

Hataraku Meeru

unread,
Jul 8, 2014, 6:53:14 AM7/8/14
to django...@googlegroups.com
I'm pretty new at Django but I think I have gotten this when I am using something that is undefined or doesn't have a value.

Are you sure you want: self.connection.connection.converter._datetime_to_mysql(value)?

Is there one too many ".connection" s there?



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6deab4a4-99e0-4c0b-8ab8-6c4b831bf255%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages