PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : python-flask LDAP



Huhn Hur Tu
24.01.20, 15:51
Ich habe mal flask ldap auth mit dem Tutorial
https://code.tutsplus.com/tutorials/flask-authentication-with-ldap--cms-23101
ausprobieren wollen, stosse aber auf Probleme, weil ich flask bisher nur vom hoeren her kenne, der Fachman geht in Deckung ;)
Nachdem ich die modul importe auf python3 (debian buster Pakete) umgebogen habe, stehe ich vor diesem Fehler und werde nicht schlau draus
Traceback (most recent call last): File "/usr/lib/python3/dist-packages/flask/app.py", line 2463, in __call__ return self.wsgi_app(environ, start_response) File "/usr/lib/python3/dist-packages/flask/app.py", line 2449, in wsgi_app response = self.handle_exception(e) File "/usr/lib/python3/dist-packages/flask/app.py", line 1866, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/lib/python3/dist-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib/python3/dist-packages/flask/app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/lib/python3/dist-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1935, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/home/druuhl/geraffel/flask/basic_ldap/flask_app/ldap_auth_app/auth/views.py", line 23, in home return render_template('home.html') File "/usr/lib/python3/dist-packages/flask/templating.py", line 140, in render_template ctx.app, File "/usr/lib/python3/dist-packages/flask/templating.py", line 120, in _render rv = template.render(context) File "/usr/lib/python3/dist-packages/jinja2/asyncsupport.py", line 76, in render return original_render(self, *args, **kwargs) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise raise value.with_traceback(tb) File "/home/druuhl/geraffel/flask/basic_ldap/flask_app/ldap_auth_app/templates/home.html", line 1, in top-level template code {% extends 'base.html' %} File "/home/druuhl/geraffel/flask/basic_ldap/flask_app/ldap_auth_app/templates/base.html", line 29, in top-level template code {% block container %}{% endblock %} File "/home/druuhl/geraffel/flask/basic_ldap/flask_app/ldap_auth_app/templates/home.html", line 5, in block "container" {% if current_user.is_authenticated() %} TypeError: 'bool' object is not callable Das ganze tritt in diesem HTML auf
{% extends 'base.html' %} {% block container %} Welcome to the Flask-LDAP Authentication Demo {% if current_user.is_authenticated() %} Hey {{ current_user.username }}!! Click here to logout (https://www.linuxforen.de/forums/{{ url_for('auth.logout') }}) {% else %} Click here to login with LDAP (https://www.linuxforen.de/forums/{{ url_for('auth.login') }}) {% endif %} {% endblock %} Bzw. das ganze Project https://www.file-upload.net/download-13874921/ldap.tar.gz.html Gruss Stefan