A
A
amalinov2016-10-19 19:55:39
Flask
amalinov, 2016-10-19 19:55:39

How to fix this Traceback?

I put the Site from Github to Flask according to the instructions, at startup it gives out:

Traceback (most recent call last):
  File "/root/landing/lib/python2.7/site-packages/flask/app.py", line 2000, in __call__
    return self.wsgi_app(environ, start_response)
  File "/root/landing/lib/python2.7/site-packages/flask/app.py", line 1991, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/root/landing/lib/python2.7/site-packages/flask/app.py", line 1567, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/root/landing/lib/python2.7/site-packages/flask/app.py", line 1988, in wsgi_app
    response = self.full_dispatch_request()
  File "/root/landing/lib/python2.7/site-packages/flask/app.py", line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/root/landing/lib/python2.7/site-packages/flask/app.py", line 1544, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/root/landing/lib/python2.7/site-packages/flask/app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File "/root/landing/lib/python2.7/site-packages/flask_debugtoolbar/__init__.py", line 125, in dispatch_request
    return view_func(**req.view_args)
  File "/root/landing/project/main/views.py", line 41, in index
    return render_template('main/index.html', form=form)
  File "/root/landing/lib/python2.7/site-packages/flask/templating.py", line 134, in render_template
    context, ctx.app)
  File "/root/landing/lib/python2.7/site-packages/flask/templating.py", line 116, in _render
    rv = template.render(context)
  File "/root/landing/lib/python2.7/site-packages/jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "/root/landing/lib/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/root/landing/project/templates/main/index.html", line 1, in top-level template code
    {% extends "_base.html" %}
  File "/root/landing/project/templates/_base.html", line 17, in top-level template code
    {% include "navigation.html" %}
  File "/root/landing/project/templates/navigation.html", line 17, in top-level template code
    {% if current_user.is_authenticated() %}
AttributeError: 'bool' object has no attribute '__call__'

How can this be fixed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aRegius, 2016-10-19
@amalinov

Judging by what I see and read - try to remove the brackets:
instead of {% if current_user.is_authenticated () %}
so {% if current_user.is_authenticated %}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question