Internal Server Error: /demo/machineinfo.html
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\django\core\handlers\exception.py", line 41, in inner
response = get_response(request)
File "C:\Python27\lib\site-packages\django\core\handlers\base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:\Python27\lib\site-packages\django\core\handlers\base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "G:\python\project\myApp\machineviews.py", line 25, in htmlmachineinfo
print machineinfo.objects.filter(serialNumber=machineser)
File "C:\Python27\lib\site-packages\django\db\models\query.py", line 226, in __repr__
data = list(self[:REPR_OUTPUT_SIZE + 1])
File "C:\Python27\lib\site-packages\django\db\models\query.py", line 250, in __iter__
self._fetch_all()
File "C:\Python27\lib\site-packages\django\db\models\query.py", line 1118, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "C:\Python27\lib\site-packages\django\db\models\query.py", line 62, in __iter__
for row in compiler.results_iter(results):
File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", line 842, in results_iter
row = self.apply_converters(row, converters)
File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", line 827, in apply_converters
value = converter(value, expression, self.connection, self.query.context)
File "C:\Python27\lib\site-packages\django\db\backends\mysql\operations.py", line 239, in convert_datetimefield_value
value = timezone.make_aware(value, self.connection.timezone)
File "C:\Python27\lib\site-packages\django\utils\timezone.py", line 285, in make_aware
return timezone.localize(value, is_dst=is_dst)
File "C:\Python27\lib\site-packages\pytz\__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)
相关时间语句先注释掉,然后在执行,目前还没找到解决办法,先绕过
后续有决解办法在进行更新

AttributeError: 'unicode' object has no attribute 'tzinfo' 未解决的更多相关文章

  1. celery:Unrecoverable error: AttributeError("'unicode' object has no attribute 'iteritems')

    环境描述 python2+django1.9下使用celery异步处理耗时请求. celery使用的是celery-with-redis这个第三方库,版本号为3.0. pip install cele ...

  2. 对于AttributeError: 'Flask' object has no attribute 'cli'的解决办法

    版权声明:本文为博主原创文章,未经博主允许不得转载. 环境flask-script2.0.5.flask0.10.1 运行官方文档sample 出现问题 c:\kk\flask\examples\fl ...

  3. PyQt程序执行时报错:AttributeError: 'winTest' object has no attribute 'setCentralWidget'的解决方法

    用QtDesigner设计了一个UI界面,保存在文件Ui_wintest.ui中,界面中使用了MainWindow窗口,窗口名字也叫MainWindow,用PyUIC将其转换成了 Ui_wintest ...

  4. AttributeError: 'module' object has no attribute 'X509_up_ref'

    主要报错: AttributeError: 'module' object has no attribute 'X509_up_ref' 1 解决办法 卸载再重装pyOpenSSL pip unins ...

  5. 在运行create_list.sh时候报错:AttributeError: 'module' object has no attribute 'LabelMap'

    Traceback (most recent call last):File "/opt/xuben-project/caffe/data/VOC0712/../../scripts/cre ...

  6. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

  7. AttributeError: 'list' object has no attribute 'write_pdf'

    我在可视化决策树,运行以下代码时报错:AttributeError: 'list' object has no attribute 'write_pdf' 我使用的是python3.4 from sk ...

  8. attributeError:'module' object has no attribute ** 解决办法

    写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...

  9. AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'

    /*************************************************************************** * AttributeError: 'modu ...

随机推荐

  1. OurEDA慕课网开发记录

    项目说明 OurEDA实验室每年都会面向大一新生招人,每周的沙龙都会有学长来讲课,传经验,录下来的沙龙视频就非常有价值,因此,在老师的安排下,我负责开发了慕课网这样一个项目. 首要问题及其解决方案 视 ...

  2. (办公)记事本_Linux帮助命令

    参考:http://www.gulixueyuan.com/course/300/task/7086/show# 帮助命令: .man命令 1.1.man命令是Linux下的帮助指令,通过man指令可 ...

  3. swoole加密可破解吗

    程序的执行和加解密过程合二唯一,无论是内部开发人员和外部黑客攻击,即使拿到了数据和私钥和服务器的root权限,也无法解密还原数据. Swoole将加解密分成了3部分(程序+算法+私钥),缺一不可解密. ...

  4. Python 之列表切片的四大常用操作

    最近在爬一个网站的文档的时候,老师要求把一段文字切割开来,根据中间的文本分成两段 故学习了一段时间的切片操作,现把学习成果po上来与大家分享 1.何为切片? 列表的切片就是处理列表中的部分元素,是把整 ...

  5. java开发两三事(2)-java多数据源+java8stream与LocalDateTime时间差

    1. 场景描述 最近在工作中碰到的几个问题,有点坑,记录下,遇到相同或类似问题的朋友可以参考下. 2. 解决方案 2.1 拼接sql后,多数据源执行 采用Spring+DruidDataSource数 ...

  6. LinuxProbe小结

    1.修改主机名: /etc/hostname 2.配置 yum 软件仓库: (1)进入到 /etc/yum.repos.d/目录下,创建一个linuxprobe.repo的新文件(文件名称任意,结尾必 ...

  7. docker chromium/chrome: error while loading shared libraries: libXcursor.so.2: cannot open shared object file: No such file or directory

    在运行 pyppeteer 的时候,因为依赖浏览器,出现上述情况. 解决办法: 一般我们在Linux下执行某些外部程序的时候可能会提示找不到共享库的错误.原因一般有两个, 一个是操作系统里确实没有包含 ...

  8. UML简单介绍—类图详解

    类图详解 阅读本文前请先阅读:UML简单介绍—类图这么看就懂了 1.泛化关系 一个动物类: /** * 动物类 */ public class Animal { public String name; ...

  9. 松软科技web教程:JavaScript Switch 语句

    switch 语句用于基于不同条件执行不同动作. JavaScript Switch 语句 请使用 switch 语句来选择多个需被执行的代码块之一. 语法 switch(表达式) { case n: ...

  10. 【Puppeteer】puppeteer安装/常用的方法以及一个小栗子(Youtube油管自动评论)

    这里介绍的是Win平台的安装方法,其他平台请至Github>Puppeteer. 首先要安装node.js 可以看我这篇的开头>[Angular]学习笔记-环境部署.项目建立相关 1.新建 ...