Just starting web2py. Should I switch to py4web?

96 views
Skip to first unread message

Jeff Plata

unread,
Aug 2, 2023, 8:37:43 PM8/2/23
to py4web
I have started two learning projects with web2py and I find it very good. Along the way I got some gotchas but there was a community of helpful individuals who helped me out, until I encountered what seems to be a bug, two days ago. I posted the issue in the web2py google group, the web2py github issues page, and stackoverflow, all to no avail.

Should I take this as a sign to learn py4web instead?

Luca de Alfaro

unread,
Aug 2, 2023, 9:11:58 PM8/2/23
to Jeff Plata, py4web
I am biased of course, but I really really like py4web -- even compared to web2py.
For two reasons.

One is efficiency.  web2py basically at every request reloads everything -- reparses all the code, reloads all the modules, etc.  py4web instead loads the modules only at startup, so servicing of each request is much faster -- you get ... 200ms (web2py) compared to 10ms (py4web) time before starting running the code for each request.  It can have a big effect on the load of a web server.

Second, py4web uses a traditional structure for loading modules (normal import statements), so that tools like pycharm and vscode have a much easier time offering coding help.

Ok, then there is a third reason, which is a mix of, I find py4web at this point to be more elegant, and I find it comes with several improvements and nice things compared to web2py... it's also more maintained...

I teach a class using py4web and you can find all material at learn-py4web.github.io in case that's useful.

Luca

On Wed, Aug 2, 2023 at 5:37 PM Jeff Plata <jeff...@gmail.com> wrote:
I have started two learning projects with web2py and I find it very good. Along the way I got some gotchas but there was a community of helpful individuals who helped me out, until I encountered what seems to be a bug, two days ago. I posted the issue in the web2py google group, the web2py github issues page, and stackoverflow, all to no avail.

Should I take this as a sign to learn py4web instead?

--
You received this message because you are subscribed to the Google Groups "py4web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/py4web/6efcd6a8-0c44-4152-ad65-1f80048b808en%40googlegroups.com.

The Digitp

unread,
Aug 3, 2023, 7:47:48 PM8/3/23
to py4web
If I were to start fresh, I would not learn web2py, but py4web instead.

Mainly for the same reasons as Luca above.
py4web is more "pythonesque" (is this even a word?) and allows easy access to python modules (some may require a couple of tweaks)

The py4web community is very helpful and, I must say, Luca's tutorial is a great way to start as it covers all essentials and more (thanks Luca!)

I have a handful of projects in py4web; including a major one that would not be able to run with web2py due to server loads, db access (postgreSQL here), etc...
As for my web2py projects, I'm (slowly) moving them to py4web.



Massimo

unread,
Aug 6, 2023, 11:22:55 AM8/6/23
to py4web
I am very biased here but I see py4web as the future of web2py and I only maintain the former.
Reply all
Reply to author
Forward
0 new messages