Internal Server Error: /demo/machineinfo.html
Traceback (most recent call last):
File "C:Python27libsite-packagesdjangocorehandlersexception.py", line 41, in inner
response = get_response(request)
File "C:Python27libsite-packagesdjangocorehandlersase.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:Python27libsite-packagesdjangocorehandlersase.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "G:pythonprojectmyAppmachineviews.py", line 25, in htmlmachineinfo
print machineinfo.objects.filter(serialNumber=machineser)
File "C:Python27libsite-packagesdjangodbmodelsquery.py", line 226, in __repr__
data = list(self[:REPR_OUTPUT_SIZE + 1])
File "C:Python27libsite-packagesdjangodbmodelsquery.py", line 250, in __iter__
self._fetch_all()
File "C:Python27libsite-packagesdjangodbmodelsquery.py", line 1118, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "C:Python27libsite-packagesdjangodbmodelsquery.py", line 62, in __iter__
for row in compiler.results_iter(results):
File "C:Python27libsite-packagesdjangodbmodelssqlcompiler.py", line 842, in results_iter
row = self.apply_converters(row, converters)
File "C:Python27libsite-packagesdjangodbmodelssqlcompiler.py", line 827, in apply_converters
value = converter(value, expression, self.connection, self.query.context)
File "C:Python27libsite-packagesdjangodbackendsmysqloperations.py", line 239, in convert_datetimefield_value
value = timezone.make_aware(value, self.connection.timezone)
File "C:Python27libsite-packagesdjangoutils imezone.py", line 285, in make_aware
return timezone.localize(value, is_dst=is_dst)
File "C:Python27libsite-packagespytz\__init__.py", line 222, in localize
if dt.tzinfo is not None:
AttributeError: 'unicode' object has no attribute 'tzinfo'
临时决解方案把数据库里面的
models.DateTimeField(auto_now_add=True)
相关时间语句先注释掉,然后在执行,目前还没找到解决办法,先绕过
后续有决解办法在进行更新