print()在django中不起作用

时间:2017-05-25 15:46:08

标签: python django

我在使用print()时遇到错误,如下代码

programsListItems = programsList['items']
programsNextPage = programsList['nextPageURL']
print("check")

并且在浏览器中我收到这样的错误

write() argument must be str, not bytes

,日志如下

 File "C:\Users\....\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 41, in inner
    response = get_response(request)
  File "C:\Users\....\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "C:\Users\....\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "F:\WORK\AdminDashBoard\admin_dashboard\search\views.py", line 99, in institutedetails
    print("check")
  File "C:\Users\....\AppData\Local\Programs\Python\Python36-32\lib\codecs.py", line 377, in write
    self.stream.write(data)
TypeError: write() argument must be str, not bytes

0 个答案:

没有答案