quokkaproject / quokka

LOOKING FOR NEW MAINTAINER - Quokka is a Content Management System - `docker run --rm -it -p 5000:5000 quokka/quokka`
http://www.quokkaproject.org
Other
2.23k stars 448 forks source link

"TypeError: object of type 'NoneType' has no len()" error #301

Closed wangyishuai007 closed 9 years ago

wangyishuai007 commented 9 years ago

createuser

[root@xfwy quokka]# python manage.py accounts_createsuperuser

INFO in fixtures [/data/git/quokka/quokka/ext/fixtures.py:14]: Loading fixtures

No handlers could be found for logger "root"

WARNING in fixtures [/data/git/quokka/quokka/ext/fixtures.py:25]: Could not create initial user and post

Name: ^CAborted!

populate

(quokka-env)[root@xfwy quokka]# python manage.py populate 15.09 11:55:44 root INFO Exist: User: mail: admin@example.com 15.09 11:55:44 root INFO ChannelType get: list 15.09 11:55:44 root INFO ChannelType get: blog 15.09 11:55:44 root INFO ChannelType get: grid 15.09 11:55:44 root INFO ChannelType get: portal 15.09 11:55:44 root INFO Channel get: Home 15.09 11:55:44 root INFO Channel get: Media 15.09 11:55:44 root INFO Channel get: Images 15.09 11:55:44 root INFO Channel get: Videos 15.09 11:55:44 root INFO Channel get: Audios 15.09 11:55:44 root INFO Channel get: Files 15.09 11:55:44 root INFO Channel get: Galleries 15.09 11:55:44 root WARNING No user found: 'NoneType' object has no attribute 'id' 15.09 11:55:44 root INFO Created channel: Articles 15.09 11:55:44 root WARNING No user found: 'NoneType' object has no attribute 'id' 15.09 11:55:44 root INFO Created channel: Technology 15.09 11:55:44 root WARNING No user found: 'NoneType' object has no attribute 'id' 15.09 11:55:44 root INFO Created channel: Mobile 15.09 11:55:44 root WARNING No user found: 'NoneType' object has no attribute 'id' 15.09 11:55:44 root INFO Created channel: Programming 15.09 11:55:44 root WARNING No user found: 'NoneType' object has no attribute 'id' 15.09 11:55:44 root INFO Created channel: Science 15.09 11:55:44 root WARNING No user found: 'NoneType' object has no attribute 'id' 15.09 11:55:44 root INFO Created channel: Blog 15.09 11:55:44 root WARNING No user found: 'NoneType' object has no attribute 'id' 15.09 11:55:44 root INFO Channel get: Articles 15.09 11:55:44 root INFO Channel get: Blog 15.09 11:55:44 root INFO Post get: Python Reaches New Levels of Quality 15.09 11:55:44 root WARNING No user found: 'NoneType' object has no attribute 'id' 15.09 11:55:44 root INFO Channel get: Articles 15.09 11:55:44 root INFO Channel get: Blog 15.09 11:55:44 root INFO Post get: Small Acts Make Great Revolutions 15.09 11:55:44 root WARNING No user found: 'NoneType' object has no attribute 'id' 15.09 11:55:44 root INFO Channel get: Articles 15.09 11:55:44 root INFO Channel get: Blog 15.09 11:55:44 root INFO Post get: Welcome to Quokka CMS 15.09 11:55:44 root WARNING No user found: 'NoneType' object has no attribute 'id' 15.09 11:55:44 root INFO Channel get: Articles 15.09 11:55:44 root INFO Channel get: Blog 15.09 11:55:44 root INFO Post get: Blog Post written in markdown 15.09 11:55:44 root WARNING No user found: 'NoneType' object has no attribute 'id' 15.09 11:55:44 root INFO Channel get: Articles 15.09 11:55:44 root INFO Channel get: Blog 15.09 11:55:44 root INFO Post get: Why is Flask a good web framework choice?

runserver error

Traceback (most recent call last): File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1836, in call return self.wsgi_app(environ, start_response) File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app response = self.make_response(self.handle_exception(e)) File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception reraise(exc_type, exc_value, tb) File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app response = self.full_dispatch_request() File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request rv = self.handle_user_exception(e) File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception reraise(exc_type, exc_value, tb) File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request rv = self.dispatch_request() File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request return self.view_functionsrule.endpoint File "/root/quokka-env/lib/python2.7/site-packages/flask/views.py", line 84, in view return self.dispatch_request(_args, _kwargs) File "/root/quokka-env/lib/python2.7/site-packages/flask/views.py", line 149, in dispatch_request return meth(_args, _kwargs) File "/data/git/quokka/quokka/modules/authors/views.py", line 27, in get author=author, contents=contents) File "/data/git/quokka/quokka/core/templates.py", line 16, in render_template return render_theme_template(theme, template, _context) File "/root/quokka-env/lib/python2.7/site-packages/quokka_themes/init.py", line 184, in render_theme_template return render_template('_themes/%s/%s' % (theme, last), _context) File "/root/quokka-env/lib/python2.7/site-packages/flask/templating.py", line 128, in render_template context, ctx.app) File "/root/quokka-env/lib/python2.7/site-packages/flask/templating.py", line 110, in _render rv = template.render(context) File "/root/quokka-env/lib/python2.7/site-packages/jinja2/environment.py", line 989, in render return self.environment.handle_exception(exc_info, True) File "/root/quokka-env/lib/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception reraise(exc_type, exc_value, tb) File "/data/git/quokka/quokka/themes/pure/templates/authors/detail.html", line 2, in top-level template code {% extends theme("base.html") %} File "/data/git/quokka/quokka/themes/pure/templates/base.html", line 16, in top-level template code {% block meta %}{% endblock %} File "/data/git/quokka/quokka/themes/pure/templates/authors/detail.html", line 17, in block "meta"

File "/root/quokka-env/lib/python2.7/site-packages/jinja2/filters.py", line 476, in do_truncate if len(s) <= length: TypeError: object of type 'NoneType' has no len()

This should be how do?

superleemo commented 9 years ago

same to me!

wangyishuai007 commented 9 years ago

Thank you for your answer Now, do not report 'typeerror' error, but there is a new error, as follows: open http://192.168.1.98:5000/admin/

Traceback (most recent call last): File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1836, in call return self.wsgi_app(environ, start_response) File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app response = self.make_response(self.handle_exception(e)) File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception reraise(exc_type, exc_value, tb) File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app response = self.full_dispatch_request() File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request rv = self.handle_user_exception(e) File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception reraise(exc_type, exc_value, tb) File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request rv = self.dispatch_request() File "/root/quokka-env/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request return self.view_functionsrule.endpoint File "/root/quokka-env/lib/python2.7/site-packages/flask_admin/base.py", line 64, in inner abort = self._handle_view(f.name, **kwargs) File "/data/git/quokka/quokka/core/admin/models.py", line 53, in _handle_view if not current_user.is_authenticated(): TypeError: 'bool' object is not callable

wangyishuai007 commented 9 years ago

My system information as follows:

CentOS 6.6 Linux xfwy 2.6.32-504.23.4.el6.x86_64 # 1 SMP Tue Jun 9 20:57:37 UTC 2015 x86_64 x86_64 x86_64 GNU / Linux python 2.7.10

rochacbruno commented 9 years ago

This is a problem in flask-login update https://github.com/maxcountryman/flask-login/commit/3f3c57aaa631093af843aa7757a7692218f1d47f

rochacbruno commented 9 years ago

@wangyishuai007 should now be fixed, please install it again, I had to downgrade flask-login to 0.2.11

pip install flask-login==0.2.11

because they broke compatibility in the https://github.com/maxcountryman/flask-login/issues/230

wangyishuai007 commented 9 years ago

Thank you very much, and now everything is normal.