politik-bei-uns / politik-bei-uns-web-old

Offenes Ratsinformationssystem: Weboberfläche
BSD 3-Clause "New" or "Revised" License
12 stars 6 forks source link

"UndefinedError: 'dict object' has no attribute ..." #28

Closed akuckartz closed 9 years ago

akuckartz commented 9 years ago

Nach Abarbeitung von https://github.com/okfde/ris-web/wiki/Installation und Aufruf von http://localhost:23000 sehe ich dies. Hierzu eine Idee?

jinja2.exceptions.UndefinedError

UndefinedError: 'dict object' has no attribute u'5482ec449bcda40691218ef1'
Traceback (most recent call last)

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__

    return self.wsgi_app(environ, start_response)

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app

    response = self.make_response(self.handle_exception(e))

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception

    reraise(exc_type, exc_value, tb)

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app

    response = self.full_dispatch_request()

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request

    rv = self.handle_user_exception(e)

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception

    reraise(exc_type, exc_value, tb)

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request

    rv = self.dispatch_request()

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request

    return self.view_functions[rule.endpoint](**req.view_args)

    File "/srv/www/ris-web/webapp/views.py", line 66, in index

    html = render_template('index.html', session=session)

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/flask/templating.py", line 128, in render_template

    context, ctx.app)

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/flask/templating.py", line 110, in _render

    rv = template.render(context)

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render

    return self.environment.handle_exception(exc_info, True)

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception

    reraise(exc_type, exc_value, tb)

    File "/srv/www/ris-web/webapp/templates/index.html", line 1, in top-level template code

    {% extends "layout.html" %}

    File "/srv/www/ris-web/webapp/templates/layout.html", line 1, in top-level template code

    {% extends "bootstrap/base.html" %}

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/flask_bootstrap/templates/bootstrap/base.html", line 1, in top-level template code

    {% block doc -%}

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/flask_bootstrap/templates/bootstrap/base.html", line 4, in block "doc"

    {%- block html %}

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/flask_bootstrap/templates/bootstrap/base.html", line 20, in block "html"

    {% block body -%}

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/flask_bootstrap/templates/bootstrap/base.html", line 23, in block "body"

    {% block content -%}

    File "/srv/www/ris-web/webapp/templates/layout.html", line 79, in block "content"

    {% block riscontent %}{% endblock %}

    File "/srv/www/ris-web/webapp/templates/index.html", line 43, in block "riscontent"

    <div id="region-question" class="question">Ausgewählte Region: <span id="region-current">{{ config['regions'][region_id]['name'] }}</span> <span id="change-region" class="awesome extrawide">Ändern</span></div>

    File "/srv/www/ris-web/venv/lib/python2.7/site-packages/jinja2/environment.py", line 378, in getitem

    return obj[argument]

    UndefinedError: 'dict object' has no attribute u'5482ec449bcda40691218ef1'

The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.

To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.

You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:

    dump() shows all variables in the frame
    dump(obj) dumps all that's known about the object
the-infinity commented 9 years ago

Keine default region gesetzt?

akuckartz commented 9 years ago

http://localhost:23000/admin/config :

  "region_default": "5569b389a5835f17fd1f6a36", 

http://localhost:23000/admin/regions enthält eine Zeile:

5569b389a5835f17fd1f6a36    Deutschland     edit
the-infinity commented 9 years ago

5482ec449bcda40691218ef1 ist allerdings noch die in https://github.com/okfde/ris-web/blob/master/config/init.config.json vorhandene ID. Ggf. Entwicklungsserver nach dem Speichern der Config nicht neu gestartet?

akuckartz commented 9 years ago

Neustart hat geholfen!

Ich werde die Dokumentation noch ergänzen und schliesse dieses und andere Issues danach.

akuckartz commented 9 years ago

Notwendigkeit des Neustarts ist am Ende der Installationsanleitung aufgenommen.