py4web 0.1.20200210.2 installed
Created "myapp" from scaffold
Tried 127.0.0.1:8000/myapp

Error:

Traceback (most recent call last):

  File "C:\Python37\lib\site-packages\py4web\core.py", line 547, in wrapper

    ret = func(*func_args, **func_kwargs)

  File "C:\Python37\lib\site-packages\py4web\core.py", line 508, in wrapper

    ret = func(*args, **kwargs)

  File "apps\myapp\controllers.py", line 36, in index

    message = T("Hello {first_name}".format(**user))

KeyError: 'first_name'


I think the app needs at first a registered user, but @authenticated() does
not ask for.

@authenticated()
def index():
    user = auth.get_user()
    message = T("Hello {first_name}".format(**user))
    return dict(message=message, user=user)


Regards Martin

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAMcwXCcT%2B2M6eEatHUZDAX6f9X1GSD8gB1iArUSbmJY17KDaZQ%40mail.gmail.com.

Reply via email to