TypeError at /admin/booktest/bookinfo/ expected string or buffer

Posted huao990928

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了TypeError at /admin/booktest/bookinfo/ expected string or buffer相关的知识,希望对你有一定的参考价值。

问题描述:

Request Method: GET
Request URL: http://127.0.0.1:8000/admin/booktest/bookinfo/
Django Version: 1.8.2
Exception Type: TypeError
Exception Value:
expected string or buffer
Exception Location: /home/python/.virtualenvs/h1/local/lib/python2.7/site-packages/django/utils/dateparse.py in parse_datetime, line 93
Python Executable: /home/python/.virtualenvs/h1/bin/python
Python Version: 2.7.12
Python Path:
[‘/home/python/Desktop/projects/test1‘,
 ‘/home/python/.virtualenvs/h1/lib/python2.7‘,
 ‘/home/python/.virtualenvs/h1/lib/python2.7/plat-x86_64-linux-gnu‘,
 ‘/home/python/.virtualenvs/h1/lib/python2.7/lib-tk‘,
 ‘/home/python/.virtualenvs/h1/lib/python2.7/lib-old‘,
 ‘/home/python/.virtualenvs/h1/lib/python2.7/lib-dynload‘,
 ‘/usr/lib/python2.7‘,
 ‘/usr/lib/python2.7/plat-x86_64-linux-gnu‘,
 ‘/usr/lib/python2.7/lib-tk‘,
 ‘/home/python/.virtualenvs/h1/local/lib/python2.7/site-packages‘,
 ‘/home/python/.virtualenvs/h1/lib/python2.7/site-packages‘]
Server time: 星期一, 7 五月 2018 22:48:29 +0800

原因

这是因为:创建的应用里面的模型里面的类的属性修改之后没有重新生成迁移。导致数据库传过来的数据表不能和python交互。重新用python manage.py生成迁移。然后创建超级用户。最后开启服务器。问题解决。

以上是关于TypeError at /admin/booktest/bookinfo/ expected string or buffer的主要内容,如果未能解决你的问题,请参考以下文章

python继承初始化对象实例时 TypeError: module() takes at most 2 arguments (3 given)

IONIC : TypeError: Object(...) is not a function at Geolocation.getCurrentPosition

NodeJs 使用 ExpressJs : TypeError: string is not a function at Function.app.render

error = "TypeError: Object [object Object] has no method 'addUnique'\n at main.js:33:12";云

已解决 - 未捕获的 TypeError: $(...).datetimepicker is not a function at app.js:61

在vue-cli中使用axios时报错TypeError: Cannot set property 'lists' of undefined at eval