weijiang1994 / Blogin

A blog system depend on flask.使用flask框架开发的个人博客系统.
https://2dogz.cn
GNU General Public License v3.0
509 stars 99 forks source link

AttributeError: 'NoneType' object has no attribute 'content' #15

Closed tianke0711 closed 3 years ago

tianke0711 commented 3 years ago

我现在允许OK啦,但是老是出现这个问题,在运行terminal上。 rv = f(*args, **kwargs) File "/Users/xx/PycharmProjects/Blogin/blogin/blueprint/front/blog.py", line 308, in load_one return jsonify({'one': one.content}) AttributeError: 'NoneType' object has no attribute 'content'

weijiang1994 commented 3 years ago

你可以在redis中增加一个键'one'然后随便赋值一个,例如{'one': '白日依山经,黄河入海流。'} 或者在数据库的one_sentence表中增加一条数据,日期就是今天

tianke0711 commented 3 years ago

@weijiang1994 OK 我试试