2to3

97 views
Skip to first unread message

Davey Marsden

unread,
Dec 12, 2020, 12:37:44 PM12/12/20
to web2py-users
I'm looking to run 2to3 to upgrade my python code.  How do I get it?  Is it easy to do?  Is it worth it?

Can I run my web2py 2.21.1 with python 2.7 or must I use python 3?

thanks
Davey

villas

unread,
Dec 14, 2020, 9:52:49 AM12/14/20
to web2py-users
The framework is compatible with both. 
However, your own code may only be compatible with one or the other - that's up to you.
Once you get to know what the differences are, you can scan the code pretty easily yourself.  Still, the 2to3 is helpful if you have lots of code.
One simplistic approach is simply to make a copy of your app,  try it under python 3, and fix what is broken.
Important:  anyone making such a conversion is being increasingly encouraged to also consider porting it to py4web.  This is a steeper learning curve,  but it may be a better long term solution.

Alexei Vinidiktov

unread,
Dec 25, 2020, 7:10:30 AM12/25/20
to web2py-users
What are the benefits of porting to py4web?

I use json-rpc2 extensively in my web2py app.

Does py4web support json-rpc2 (or other rpc services) out of the box the way web2py does?

Does it support jwt authentication the way web2py does?

Is py4web stable and mature enough to consider switching?

Massimo Di Pierro

unread,
Dec 31, 2020, 2:36:31 PM12/31/20
to web2py-users
you can use json-rpc2 with py4web but it is not built-into the framework. It does not need to be. I will post an example.

py4web has jwt auth support although the syntax is a different.

py4web is not as mature as web2py but very mature. The pros are the speed, the cleaner/leaner implementation and works better with third party modules. At this time more development is going into py4web than into web2py.

I think web2py remains the only choice for python2. If you are moving to python3 than you have a choice.
Reply all
Reply to author
Forward
0 new messages