py4web shell

232 views
Skip to first unread message

Marcello

unread,
Sep 24, 2019, 10:49:09 PM9/24/19
to web2py-users
Hello all,

Does py4web already have a shell like web2py?

Thanks

Massimo Di Pierro

unread,
Sep 25, 2019, 12:08:42 AM9/25/19
to web2py-users
It does not need it. You can use a regular python shell and do:

from py4web import *
from apps.myapp.models import db

etc.

py4web unlike web2py has not magic and apps are modules.

Marcello

unread,
Sep 25, 2019, 9:56:32 AM9/25/19
to web2py-users
Great Massimo.

Thank you.

Marcello

unread,
Sep 25, 2019, 12:11:12 PM9/25/19
to web2py-users
Massimo,

Tried what you suggested, but got this error.


Python 3.6.8 (default, Aug 20 2019, 17:12:48)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from py4web import *                                                                                                                                                      
>>> from apps.todo.models import db                                                                                                                                           
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tecno2/py4web/apps/myapp/__init__.py", line 15, in <module>
    @action.uses(session)               # action needs a session object (read/write cookies)
  File "/home/tecno2/py4web/py4web/core.py", line 494, in __call__
    app_name = action.app_name
AttributeError: type object 'action' has no attribute 'app_name'
>>>


Something wrong here ??

Massimo Di Pierro

unread,
Sep 26, 2019, 2:57:46 AM9/26/19
to web2py-users
Oops. Will fix it tomorrow.

Massimo Di Pierro

unread,
Sep 27, 2019, 12:20:51 AM9/27/19
to web2py-users
Fixed. please try now.

On Wednesday, 25 September 2019 23:57:46 UTC-7, Massimo Di Pierro wrote:
Oops. Will fix it tomorrow.

Marcello

unread,
Sep 27, 2019, 9:10:52 AM9/27/19
to web2py-users
Worked now.

Thanks Massimo...

Marcello

unread,
Sep 27, 2019, 3:45:04 PM9/27/19
to web2py-users
Hi again....

There seems to be a problem with ipython when imports py4web...
Are you aware of it ?

Massimo Di Pierro

unread,
Sep 28, 2019, 3:47:55 AM9/28/19
to web2py-users
wow. I see it. Very strange ipyhton bug.
Reply all
Reply to author
Forward
0 new messages