Finally solved this problem by installing python3-dev &
libmysqlclient-dev and then I was able to install mysqlclient.
Case closed!!!
On Tuesday, 01 May, 2018 07:09 PM, Gerald Brown wrote:
As a follow-up with further information. This error occurs when on
the Admin login screen I enter the user name and password and then
click "SUBMIT".
The Exception Location is:
"/home/medrec2/.virtualenvs/medrecproj/lib/python3.5/site-packages/*mysql*/connector/conversion.py
in _DATETIME_to_python, line 506".
Is there another db connector I can use to connect to the Mariadb
database?
On Tuesday, May 1, 2018 at 7:45:47 AM UTC+8, Gerald Brown wrote:
I had replied to Daniel Roseman instead of to the users group as I
am new to this group.
Thanks to Daniel for his response
-------- Forwarded Message --------
Subject: Re: AttributeError at /admin/login/
Date: Mon, 30 Apr 2018 21:46:35 +0800
From: Gerald Brown
To: Daniel Roseman
No. You need to show the full traceback.
--
DR.
--
Here is the full traceback. It is quite long.
AttributeError at /admin/login/
'datetime.datetime' object has no attribute 'split'
Request Method: POST
Request URL: http://192.168.0.122/admin/login/?next=/admin/
<http://192.168.0.122/admin/login/?next=/admin/>
Django Version: 2.0.4
Exception Type: AttributeError
Exception Value:
'datetime.datetime' object has no attribute 'split'
Exception Location:
/home/medrec2/.local/lib/python3.6/site-packages/mysql/connector/conversion.py
in _DATETIME_to_python, line 506
Python Executable:
/home/medrec2/.virtualenvs/medrecproj/bin/python3.6
Python Version: 3.6.5
Python Path:
['/home/medrec2/medrecproj',
'/home/medrec2/.virtualenvs/medrecproj/bin',
'/usr/local/lib/python36.zip',
'/usr/local/lib/python3.6',
'/usr/local/lib/python3.6/lib-dynload',
'/home/medrec2/.local/lib/python3.6/site-packages',
'/usr/local/lib/python3.6/site-packages']
Server time: Sun, 29 Apr 2018 18:31:23 +0800
Traceback Switch to copy-and-paste view
<http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/core/handlers/exception.py|
in |inner|
35.
response = get_response(request)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/core/handlers/base.py|
in |_get_response|
128.
response = self.process_exception_by_middleware(e,
request)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/core/handlers/base.py|
in |_get_response|
126.
response = wrapped_callback(request,
*callback_args, **callback_kwargs)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/views/decorators/cache.py|
in |_wrapped_view_func|
44.
response = view_func(request, *args, **kwargs)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/contrib/admin/sites.py|
in |login|
398.
return LoginView.as_view(**defaults)(request)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/views/generic/base.py|
in |view|
69.
return self.dispatch(request, *args, **kwargs)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py|
in |_wrapper|
62.
return bound_func(*args, **kwargs)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/views/decorators/debug.py|
in |sensitive_post_parameters_wrapper|
76.
return view(request, *args, **kwargs)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py|
in |bound_func|
58.
return func.__get__(self, type(self))(*args2,
**kwargs2)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py|
in |_wrapper|
62.
return bound_func(*args, **kwargs)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py|
in |_wrapped_view|
142.
response = view_func(request, *args, **kwargs)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py|
in |bound_func|
58.
return func.__get__(self, type(self))(*args2,
**kwargs2)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py|
in |_wrapper|
62.
return bound_func(*args, **kwargs)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/views/decorators/cache.py|
in |_wrapped_view_func|
44.
response = view_func(request, *args, **kwargs)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/utils/decorators.py|
in |bound_func|
58.
return func.__get__(self, type(self))(*args2,
**kwargs2)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/contrib/auth/views.py|
in |dispatch|
66.
return super().dispatch(request, *args, **kwargs)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/views/generic/base.py|
in |dispatch|
89.
return handler(request, *args, **kwargs)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/views/generic/edit.py|
in |post|
141.
if form.is_valid():
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
* |/home/medrec2/.local/lib/python3.6/site-packages/django/forms/forms.py|
in |is_valid|
179.
return self.is_bound and not self.errors
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
* |/home/medrec2/.local/lib/python3.6/site-packages/django/forms/forms.py|
in |errors|
174.
self.full_clean()
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
* |/home/medrec2/.local/lib/python3.6/site-packages/django/forms/forms.py|
in |full_clean|
377.
self._clean_form()
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
* |/home/medrec2/.local/lib/python3.6/site-packages/django/forms/forms.py|
in |_clean_form|
404.
cleaned_data = self.clean()
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/contrib/auth/forms.py|
in |clean|
195.
self.user_cache = authenticate(self.request,
username=username, password=password)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/contrib/auth/__init__.py|
in |authenticate|
70.
user = _authenticate_with_backend(backend,
backend_path, request, credentials)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/contrib/auth/__init__.py|
in |_authenticate_with_backend|
116.
return backend.authenticate(*args, **credentials)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/contrib/auth/backends.py|
in |authenticate|
16.
user =
UserModel._default_manager.get_by_natural_key(username)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/contrib/auth/base_user.py|
in |get_by_natural_key|
44.
return self.get(**{self.model.USERNAME_FIELD: username})
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/db/models/manager.py|
in |manager_method|
82.
return getattr(self.get_queryset(), name)(*args,
**kwargs)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/db/models/query.py|
in |get|
397.
num = len(clone)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/db/models/query.py|
in |__len__|
254.
self._fetch_all()
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/db/models/query.py|
in |_fetch_all|
1179.
self._result_cache = list(self._iterable_class(self))
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/db/models/query.py|
in |__iter__|
62.
for row in compiler.results_iter(results):
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/db/models/sql/compiler.py|
in |apply_converters|
1006.
for row in map(list, rows):
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/db/models/sql/compiler.py|
in |cursor_iter|
1461.
for rows in iter((lambda: cursor.fetchmany(itersize)),
sentinel):
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/django/db/models/sql/compiler.py|
in |<lambda>|
1461.
for rows in iter((lambda: cursor.fetchmany(itersize)),
sentinel):
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
* |/home/medrec2/.local/lib/python3.6/site-packages/django/db/utils.py|
in |inner|
96.
return func(*args, **kwargs)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/mysql/connector/cursor_cext.py|
in |fetchmany|
510.
rows.extend(self._cnx.get_rows(size))
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/mysql/connector/connection_cext.py|
in |get_rows|
275.
row[i])
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/mysql/connector/conversion.py|
in |to_python|
205.
return self._cache_field_types[vtype[1]](value, vtype)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/mysql/connector/django/base.py|
in |_DATETIME_to_python|
119.
dt = MySQLConverter._DATETIME_to_python(self, value)
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
*
|/home/medrec2/.local/lib/python3.6/site-packages/mysql/connector/conversion.py|
in |_DATETIME_to_python|
506.
(date_, time_) = value.split(b' ')
...
▶ Local vars <http://192.168.0.122/admin/login/?next=/admin/#>
As it shows most of the errors occur in the
site-packages/mysql/connector. I am using the
mysql-connector-python to connect to the Mariadb database. I have
this same application running on another computer and I do NOT get
this error.
Thanks for your reply.
--
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+unsubscr...@googlegroups.com
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/583559d9-1d45-429e-adc0-51cd6d408104%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/583559d9-1d45-429e-adc0-51cd6d408104%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/c3c7431f-e6d6-10ee-3cda-2722789be710%40gmail.com.
For more options, visit https://groups.google.com/d/optout.