web3py again....

387 views
Skip to first unread message

Massimo Di Pierro

unread,
Mar 28, 2019, 5:16:15 AM3/28/19
to web2py-users
I know this comes up once in a while but ...


what do you think?

It is very preliminary but I will have an admin soon.
Backporting SQLFORM, grid and Auth, should not be that complicated, although I think we can do better.

Massimo

José Luis Redrejo

unread,
Mar 28, 2019, 5:57:08 AM3/28/19
to web...@googlegroups.com
Just tested, some considerations:

1. Tested with Python 3.6, followig strictly the provided instructions, several things don't work:
a) static folder is not working properly. I get a 404 error for all the requests
127.0.0.1 - - [28/Mar/2019 10:45:10] "GET /todo/index HTTP/1.1" 200 828
127.0.0.1 - - [28/Mar/2019 10:45:10] "GET /todo/static/js/sugar.min.js HTTP/1.1" 404 774
127.0.0.1 - - [28/Mar/2019 10:45:10] "GET /todo/static/js/axios.min.js HTTP/1.1" 404 774
127.0.0.1 - - [28/Mar/2019 10:45:10] "GET /todo/static/js/vue.min.js HTTP/1.1" 404 770
127.0.0.1 - - [28/Mar/2019 10:45:10] "GET /todo/static/js/todo.js HTTP/1.1" 404 764

b) favicon requests also produce a python error:
27.0.0.1 - - [28/Mar/2019 10:44:47] "GET /favicon.ico HTTP/1.1" 404 742
Traceback (most recent call last):
  File "/opt/src/web3py/web3py.py", line 149, in load
    self.data = jwt.decode(enc_data, self.secret, algorithms=[self.algorithm])
  File "/opt/src/web3py/venv/lib/python3.6/site-packages/jwt/api_jwt.py", line 84, in decode
    payload, _, _, _ = self._load(jwt)
  File "/opt/src/web3py/venv/lib/python3.6/site-packages/jwt/api_jws.py", line 177, in _load
    binary_type))
jwt.exceptions.DecodeError: Invalid token type. Token must be a <class 'bytes'>


2. About your questions:
  • sqlform and grid are one of the key points for web2py. It's one of the main reasons to use it instead of other frameworks as development is really quick. However I think nowadays a backport from web2py is not a good idea. We should provide something optional based only on vue.js. As you say, we can do it better.
  • auth is not as important in my experience. It has never been the reason to pick web2py and there are other ways to do it.

3. about the new ideas:
  • I love the use of jwt and vue.js
  • I love it does not use custom import or eval. That will make testing much, much easier and logical.
  • I would like to have a kind of automatic integration between the backend and webpack, for modern development. It should be optional obviously, but something like django-webpack-loader should be added (or have web3py-webpack-loader as an external library that can be installed if required)

If you have a roadmap where others could lend a hand, please, tell it. Maybe creating some github issues that could be assigned to volunteers. I'd be glad to help.
José L.



--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Leonel Câmara

unread,
Mar 28, 2019, 6:29:32 AM3/28/19
to web2py-users
I haven't tried it, but looking at the code...

Can you explain a little bit more what you're trying to achieve here? 
 
This seems like it's bottle with pydal and yatl. Why not just use bottle then? It will force me to learn bottle anyway.

黄祥

unread,
Mar 28, 2019, 10:36:08 AM3/28/19
to web2py-users
great, tested it

environment
$ uname
Darwin
$ python
-V
Python 3.7.2

steps
git clone https://github.com/web2py/web3py
cd web3py
pip install
-r requirements.txt
python web3py
.py applications/
open http
://localhost:8000/todo/index

result in browser
can add (save) and delete data in browser

result in terminal
Traceback (most recent call last):

 
File "/Users/sugizo/Downloads/learn/web3py/web3py.py", line 149, in load
   
self.data = jwt.decode(enc_data, self.secret, algorithms=[self.algorithm])
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/jwt/api_jwt.py", line 84, in decode
    payload
, _, _, _ = self._load(jwt)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/jwt/api_jws.py", line 177, in _load
    binary_type
))

jwt
.exceptions.DecodeError: Invalid token type. Token must be a <class 'bytes'>

best regards,
stifan

Marcelo Huerta

unread,
Mar 28, 2019, 3:16:58 PM3/28/19
to web2py-users
El jueves, 28 de marzo de 2019, 6:57:08 (UTC-3), José L. escribió:
  • sqlform and grid are one of the key points for web2py. It's one of the main reasons to use it instead of other frameworks as development is really quick. However I think nowadays a backport from web2py is not a good idea. We should provide something optional based only on vue.js. As you say, we can do it better.

SQLFORM and grid were the main selling points to me. Something similar should be provided, surely.
 
  • auth is not as important in my experience. It has never been the reason to pick web2py and there are other ways to do it.
I love auth, actually. Maybe I haven't investigated enough, but what other ways to do it are preferable in your opinion?

junde...@qisproject.com

unread,
Mar 28, 2019, 6:36:10 PM3/28/19
to web2py-users
For authentication, Okta, Azure AD B2C, etc. are options that offload a lot of trouble, but I like having a fully-functional Auth built-in and we do use it in some projects.  It needs full OIDC support.  YMMV.  We build scalable back ends with Web2py using Postgres and Nginx.

John

黄祥

unread,
Mar 28, 2019, 6:54:02 PM3/28/19
to web2py-users
interested in github readme :
  • it is not as good as web2py yet, but it is 10-20x faster
perhaps could you share which benchmark method or tools to get this conclusion (compare with similar web2py todo apps) ? 

best regards,
stifan

Joe Barnhart

unread,
Mar 28, 2019, 9:46:47 PM3/28/19
to web2py-users
I agree that back porting web2py code should be straightforward (after all, it's not rocket science :-D).  But maybe we should revisit those modules and pare them down to minimalist proportions.  I really need Auth, complete with user roles and groups, but there's probably a better way to minimize/abstract and provide a growth path.

Plus, with py3 and web2py in hand, its not like there's a fire that needs putting out.

-- Joe

Kevin Keller

unread,
Mar 28, 2019, 11:54:04 PM3/28/19
to web...@googlegroups.com
I like the general direction of it.
Auth and sqlform backported would of course be great. 

With bottle in the middle we can tap into the bottle community extensions but also gain extra flexibility.. 

Combined with web2py sqlform and Auth etc could be a real winner 

Massimo Di Pierro

unread,
Mar 29, 2019, 12:12:25 AM3/29/19
to web2py-users
My thought exactly.

Massimo Di Pierro

unread,
Mar 29, 2019, 1:08:20 AM3/29/19
to web2py-users
People asked about the Goal. My goal is:

- preserve as much as possible of web2py syntax that we love
- much faster
- simpler code base (so far less than 300 lines of code in a single file)
- move more logic to apps and js libs
- web2py's goal was to make it simple to build complex web apps. web3py goal is the same but show that we learned from our mistakes (some, not all).

Some benchmarks on my laptop below. Real apps are likely to be slower because the actions may do more computation but this shows that the overhead of processing a simple template, a sessions, and performing a DB transaction, are about 1ms or less. Details depend on the architecture.

$ python3 web3py.py applications --workers 4

## bencharking a memoized API

$ ab -n 4000 -c 4 http://127.0.0.1:8000/todo/uuid
This is ApacheBench, Version 2.3 <$Revision: 1826891 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 400 requests
Completed 800 requests
Completed 1200 requests
Completed 1600 requests
Completed 2000 requests
Completed 2400 requests
Completed 2800 requests
Completed 3200 requests
Completed 3600 requests
Completed 4000 requests
Finished 4000 requests


Server Software:        gunicorn/19.9.0
Server Hostname:        127.0.0.1
Server Port:            8000

Document Path:          /todo/uuid
Document Length:        36 bytes

Concurrency Level:      4
Time taken for tests:   2.149 seconds
Complete requests:      4000
Failed requests:        0
Total transferred:      784000 bytes
HTML transferred:       144000 bytes
Requests per second:    1861.48 [#/sec] (mean)
Time per request:       2.149 [ms] (mean)
Time per request:       0.537 [ms] (mean, across all concurrent requests)
Transfer rate:          356.30 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   4.8      0     303
Processing:     1    2   8.3      2     305
Waiting:        1    1   6.8      1     304
Total:          1    2   9.6      2     305

Percentage of the requests served within a certain time (ms)
  50%      2
  66%      2
  75%      2
  80%      2
  90%      3
  95%      3
  98%      4
  99%      4
 100%    305 (longest request)

## bencharking a page with a simple template and session counter

$ ab -n 4000 -c 4 http://127.0.0.1:8000/todo/index
This is ApacheBench, Version 2.3 <$Revision: 1826891 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 400 requests
Completed 800 requests
Completed 1200 requests
Completed 1600 requests
Completed 2000 requests
Completed 2400 requests
Completed 2800 requests
Completed 3200 requests
Completed 3600 requests
Completed 4000 requests
Finished 4000 requests


Server Software:        gunicorn/19.9.0
Server Hostname:        127.0.0.1
Server Port:            8000

Document Path:          /todo/index
Document Length:        828 bytes

Concurrency Level:      4
Time taken for tests:   4.448 seconds
Complete requests:      4000
Failed requests:        0
Total transferred:      4864636 bytes
HTML transferred:       3312000 bytes
Requests per second:    899.23 [#/sec] (mean)
Time per request:       4.448 [ms] (mean)
Time per request:       1.112 [ms] (mean, across all concurrent requests)
Transfer rate:          1067.98 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       2
Processing:     2    4   2.3      3      47
Waiting:        2    4   2.1      3      46
Total:          2    4   2.3      4      47

Percentage of the requests served within a certain time (ms)
  50%      4
  66%      4
  75%      5
  80%      5
  90%      7
  95%      8
  98%     12
  99%     14
 100%     47 (longest request)

## bencharking a GET api that accesses pydal + sqlite

$ ab -n 4000 -c 4 http://127.0.0.1:8000/todo/api
This is ApacheBench, Version 2.3 <$Revision: 1826891 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 400 requests
Completed 800 requests
Completed 1200 requests
Completed 1600 requests
Completed 2000 requests
Completed 2400 requests
Completed 2800 requests
Completed 3200 requests
Completed 3600 requests
Completed 4000 requests
Finished 4000 requests


Server Software:        gunicorn/19.9.0
Server Hostname:        127.0.0.1
Server Port:            8000

Document Path:          /todo/api
Document Length:        324 bytes

Concurrency Level:      4
Time taken for tests:   3.349 seconds
Complete requests:      4000
Failed requests:        0
Total transferred:      1940000 bytes
HTML transferred:       1296000 bytes
Requests per second:    1194.23 [#/sec] (mean)
Time per request:       3.349 [ms] (mean)
Time per request:       0.837 [ms] (mean, across all concurrent requests)
Transfer rate:          565.63 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       1
Processing:     1    3  16.8      2     534
Waiting:        1    3  14.5      2     533
Total:          1    3  16.8      3     534

Percentage of the requests served within a certain time (ms)
  50%      3
  66%      3
  75%      3
  80%      3
  90%      4
  95%      5
  98%      5
  99%      6
 100%    534 (longest request)

## bencharking a static page

This is ApacheBench, Version 2.3 <$Revision: 1826891 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 400 requests
Completed 800 requests
Completed 1200 requests
Completed 1600 requests
Completed 2000 requests
Completed 2400 requests
Completed 2800 requests
Completed 3200 requests
Completed 3600 requests
Completed 4000 requests
Finished 4000 requests


Server Software:        gunicorn/19.9.0
Server Hostname:        127.0.0.1
Server Port:            8000

Document Path:          /todo/static/hello.txt
Document Length:        12 bytes

Concurrency Level:      4
Time taken for tests:   3.347 seconds
Complete requests:      4000
Failed requests:        0
Total transferred:      964000 bytes
HTML transferred:       48000 bytes
Requests per second:    1194.97 [#/sec] (mean)
Time per request:       3.347 [ms] (mean)
Time per request:       0.837 [ms] (mean, across all concurrent requests)
Transfer rate:          281.24 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       2
Processing:     1    3   2.3      2      53
Waiting:        1    3   1.9      2      47
Total:          1    3   2.3      3      53

Percentage of the requests served within a certain time (ms)
  50%      3
  66%      3
  75%      4
  80%      4
  90%      5
  95%      6
  98%      8
  99%     10
 100%     53 (longest request)

Massimo

José Luis Redrejo

unread,
Mar 29, 2019, 5:11:36 AM3/29/19
to web...@googlegroups.com


El vie., 29 mar. 2019 a las 5:12, Massimo Di Pierro (<massimo....@gmail.com>) escribió:
My thought exactly.


I also fully agree.
Very excited with the new features.

Also, I see the problems I reported yesterday have been solved in the git repository. Now we can begin to really play with it.
José L.


 

黄祥

unread,
Mar 30, 2019, 5:26:22 AM3/30/19
to web2py-users
on github :
what is different web2py and bottle in terms of request and response ? plus minus between it?
  • unlike web2py, web3py does not use custom import or eval
is custom import is same like import from modules folders in web2py app ?
  • dynamic module reloading is only partially supported
then what about dynamic module reload in this term ?

thanks and best regards,
stifan

黄祥

unread,
Mar 30, 2019, 10:50:57 PM3/30/19
to web2py-users
step
rm -rf ~/learn/python/web3py
cd ~/learn/python
cp -r applications/todo applications/todoo
python web3py.py applications/

result on browser

Error: 404 Not Found

Sorry, the requested URL 'http://localhost:8000/todoo' caused an error:

Not found: '/todoo'

result on terminal

127.0.0.1 - - [31/Mar/2019 09:47:52] "GET /todoo HTTP/1.1" 404 730


best regards,
stifan

Carlos Cesar Caballero Díaz

unread,
Mar 31, 2019, 1:22:16 AM3/31/19
to web...@googlegroups.com

So far looks good, but I would prefer that the application include (or import) the framework instead of the framework include the application. With the first one, pip based deployments and CI/CD will be a lot easier.

I have being playing with bottle a lot recently, so if there is some web3py features list or guidelines, maybe I can give a hand.

Greetings.


El 28/3/19 a las 5:16 a.m., Massimo Di Pierro escribió:

Massimo Di Pierro

unread,
Mar 31, 2019, 2:47:22 AM3/31/19
to web2py-users


On Saturday, 30 March 2019 02:26:22 UTC-7, 黄祥 wrote:
on github :
what is different web2py and bottle in terms of request and response ? plus minus between it?

slightly different syntax. bottle request is faster if accessed often.
  • unlike web2py, web3py does not use custom import or eval
is custom import is same like import from modules folders in web2py app ?

custom import makes sure that for every app web2py first looks in the app/modules folder. This causes some modules to break if they are designed to only work when pip installed. the new design should have these problem because does not mess with imports (at least not at the same level)
 
is eval same like in python ?

we do not use eval but in web2py we execute modules instead of importing them. This is not the case in web3py.
 
  • dynamic module reloading is only partially supported
then what about dynamic module reload in this term ?

In web2py we do not realod the modules. we reimport them at every request. this causes a performance penalty and is only needed in development.
web3py (current version) uses bottle.run(reload=True) which reloads the module if they change but crashes the whole thing if there is an import error. There is a better way and I am working on it.

Christopher Smiga

unread,
Mar 31, 2019, 2:48:10 AM3/31/19
to web2py-users
Hi Massimo and Team,

It's been a several years since contributing to the project, and I'm interested in web3py for several reasons such as

* it is a fresh project
* speed
* architecture improvements
* the future of web2py

In this effort, are pyunit (TDD), Python Behave Library (BDD), CI/CD, performance testing, functional testing, and code integrity via SonarQube being considered in the build process?

Web3Py has the potential of being the next world class web framework. What is the plan for development of this new endeavor since automation test development is important?

Thanks and regards,
Christopher Smiga
SDET (Software Development Engineer in Test)

Massimo Di Pierro

unread,
Mar 31, 2019, 2:49:26 AM3/31/19
to web2py-users

Massimo Di Pierro

unread,
Mar 31, 2019, 2:52:45 AM3/31/19
to web2py-users
Nope!
If that is what you do, just use bottle.
The whole point of web2py (which I am trying to preserve in web3py) is that the framework can run whether or not you have an application and multiple applications can be installed in a plug-and-play fashion. This means it is not logically possible for applications to be in changed of including the framework.
Anyway, unlike web2py, web3py does allow this as an option, if you want to run a single application. I just have not documented it.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.

Massimo Di Pierro

unread,
Mar 31, 2019, 2:56:23 AM3/31/19
to web2py-users
I am trying to keep it intentionally small and the API may change. For example I am going to refactor some of the decorators as bottle plugins.
About your questions. we will continue use travis-ci like we do with web3py. I like behave but may people I talked too found it hard to learn and that is contrary to web2py/web2py philosophy. If we can integrate web3py+behave+selenium using a SDL it would be a great way to generate tests for apps, not for web3py itself.

黄祥

unread,
Mar 31, 2019, 3:31:19 AM3/31/19
to web2py-users
new behaviour learned for now:
1. start server with python web3py.py applications/, then copy the app and access the new app in the browser will result : Error: 404 Not Found, solution whenever add new app must restart the server (gunicorn)
2. seems index not the default function like in web2py, no worries, just need to adapt with this new behaviour
3. the session seems store in browser like cookies, to get rid the session seems must clear the cookies in browser, tested with remove the todo app, and clone the git again, when access the todo app, the counter session will increase
4. no error traceback on browser yet, the link provided but when it's clicked return:
Error: 404 Not Found
Sorry, the requested URL 'http://localhost:8000/_error/59d20351-4496-4b4f-a8de-04768925d4b1' caused an error:

Not found: '/_error/59d20351-4496-4b4f-a8de-04768925d4b1'

check on terminal :
ERROR:root:Traceback (most recent call last):
  File "/Users/sugizo/learn/python/web3py/web3py.py", line 227, in wrapper
    output = function(*func_args, **func_kwargs)
  File "/Users/sugizo/learn/python/web3py/applications/todo0/__init__.py", line 15, in index
    session['counter'] = session.get('counter', 0) + 1
  File "/Users/sugizo/learn/python/web3py/web3py.py", line 183, in get
    return self.local.data.get(key, default)
AttributeError: '_thread._local' object has no attribute 'data'

the error no 4 occured when tried to have the previous todo app (app without bulma css) with the current update (to test backward compatibility)

best regards,
stifan

黄祥

unread,
Mar 31, 2019, 3:54:23 AM3/31/19
to web2py-users
Backporting SQLFORM, grid and Auth, should not be that complicated, although I think we can do better.

sqlform, grid and auth is a great helper to make web2py as rapid application development, but please consider some of users who want to use another css or js framework.
perhaps just follow the python principle 'Explicit is better than implicit', something like
sqlform(), sqlform.grid() or form() signature have style='bootstrap', or class='something' or tag='div|span|table|tr|td'
not sure just an idea
perhaps can stick with the initial idea
ref:

best regards,
stifan

Massimo Di Pierro

unread,
Mar 31, 2019, 1:16:18 PM3/31/19
to web2py-users
 The app that is supposed to respond to:
does not exist yet. It is an easy todo. Maybe I will do it today.

This is not going to be backward compatible for another month. Do not expect to update web3py.py and existing apps to work. Expect they will not work.

Massimo Di Pierro

unread,
Apr 2, 2019, 2:58:52 AM4/2/19
to web2py-users
Th problem with SQLFORM is that different CSS libraries require different HTML stuctures. It is not as simple as selecting a class or div vs span. In web2py we have code to deal with bootstrap 2 and 3. We apply both classes. It is horrible. We should move away from generating html server side for forms. We should pass a json description and generate it client side

Kevin Keller

unread,
Apr 2, 2019, 3:19:51 AM4/2/19
to web...@googlegroups.com
I agree. 

In fact, the whole client side today should be Javascript and just communicate via REST+JWT (even though in the enerprise space you will also need OAUTH2). 

 The models need to be exposed via REST easiliy and it should be easy to add auth to routes with JWT. Also the REST endpoints once defined, need to generate openapi(swagger) documents automatically. 

This is much like the JSON route you wanted to go, but with openapi we would be using an actual standard and do not tie ourselves to one Javascript framework and once specific JSON format. 

 With that we could use something like this: https://api-platform.com/docs/client-generator/ that generates Vue.js or React.js CRUD pages basted on teh openapi documentation for the REST endpoints. 

--
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+un...@googlegroups.com.

Kevin Keller

unread,
Apr 2, 2019, 3:31:42 AM4/2/19
to web...@googlegroups.com
https://editor.swagger.io/?_ga=2.227432986.689200959.1554189909-55439989.1547630410 

Swagger JSON editor + https://swagger.io/specification/. So one Swagger Json file can contain the description of all the endpoints. 

Kevin Keller

unread,
Apr 2, 2019, 3:56:31 AM4/2/19
to web...@googlegroups.com
Here is a project that generates swagger(openapi) documentation for flask+sqlalchemy.  https://github.com/thomaxxl/safrs
I was already wondering about changing bottle with flask, but I dont know if that is heresy now :). 

黄祥

unread,
Apr 2, 2019, 7:07:31 AM4/2/19
to web2py-users
yes, you are right, my bad, like the idea of jekpack (combine server side (jekyll ruby) with client side (webpack js), perhaps can learn from it and adapt it to web3py.
ref:
ever thought of graphql as an option to REST?

best regards,
stifan

Carlos Costa

unread,
Apr 2, 2019, 5:09:14 PM4/2/19
to web2py-users
Will it have default url routes?

beyond that,  my thought about ui widgets:
I think it would be nice:
1 - to have an easy integration via a model rest api
2- be agnostice to client side frameworks
3 - come with a default client side framework (preferably vue)
4 - have a ui lib by default
5 - have a template for building custom ui widgets using vue (like single page components or something.) that integrates easily, 
maybe with some client api, with the server

Em quinta-feira, 28 de março de 2019 06:16:15 UTC-3, Massimo Di Pierro escreveu:
I know this comes up once in a while but ...


what do you think?

It is very preliminary but I will have an admin soon.
Backporting SQLFORM, grid and Auth, should not be that complicated, although I think we can do better.

Massimo

John Underhill

unread,
Apr 2, 2019, 7:57:00 PM4/2/19
to web...@googlegroups.com
I think all this bears some brainstorming in light of what’s going on with Webassembly.

I’m not saying Javascript for building web UIs isn’t the future, but...

Ok, quick show of hands: How many people absolutely adore Javascript?  Oh wait, it doesn’t matter, because we have no choice.  Or do we?

What if we could develop the whole app in Python, front end and back end?  What if we could develop front end apps for the browser in Python, with Web2py (or its successor)?  And they ran really fast, and integrated transparently with back-end services, also written in Python?

Not sure exactly what this would look like, but I’ve been pushing it around for a while.  At the very least this has the potential to make my life much easier.  We probably need some pieces that aren’t there yet (but probably they will be shortly).

What do you all think?

John


From: web...@googlegroups.com on behalf of Carlos Costa <yamand...@gmail.com>
Sent: Tuesday, April 2, 2019 2:09 PM
To: web2py-users
Subject: [web2py] Re: web3py again....
 
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/vLw9sj6nw7M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.

Massimo Di Pierro

unread,
Apr 7, 2019, 12:32:21 AM4/7/19
to web2py-users
I like bottle because it is simpler than flask. Can you make a good case for why Flask over bottle?
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.

Kevin Keller

unread,
Apr 7, 2019, 7:25:24 AM4/7/19
to web2py-users
I couldn't find the numbers that quickly, but key point is the bigger Flask community and plugin availability. Also if people look for job for companies that use python most of the time they look for Flask or Django experience.

Web3Py build on Flask would also remove the questions for beginners if they should use Flask or Web3py in which case they will most likely start with Flask.

With Web3py having a flask component but the added value of pydal, yatl, sqlform and web2py Auth they would go for Web3py for sure.

Now I perfectly understand however, that Web3py based on bottle would have a higher potential to be its own thing and find a community of its own and possibly even increase interest in all its moving parts such as bottle in reverse. 

And also effectively reducing the risk of Web3py being seen as just an extension as it could possibly happen with Flask, but actually being seen for what it is: much more than its moving parts combined.






I guess it depends which end goal is more desirable. 



To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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+un...@googlegroups.com.

João Matos

unread,
Apr 7, 2019, 1:19:08 PM4/7/19
to web2py-users
@Massimo

You state
"In web2py we do not reload the modules. we reimport them at every request. this causes a performance penalty and is only needed in development."

Does this mean it is possible to disable module reimport at every request in web2py when in production (or did I misunderstood you)? How?


Anthony

unread,
Apr 7, 2019, 1:30:24 PM4/7/19
to web2py-users
Unless you have the following in a model file:

from gluon.custom_import import track_changes; track_changes(True)
 
modules are not reloaded. And even with the above, they are only reloaded if they have changed.

Anthony

João Matos

unread,
Apr 7, 2019, 1:33:22 PM4/7/19
to web2py-users
@Anthony

I was asking about reimport not reload.
Does track_changes appy to both?

Anthony

unread,
Apr 7, 2019, 1:51:09 PM4/7/19
to web2py-users
On Sunday, April 7, 2019 at 1:33:22 PM UTC-4, João Matos wrote:
@Anthony

I was asking about reimport not reload.
Does track_changes appy to both?

What do you mean by "reimport"?

Anthony

João Matos

unread,
Apr 7, 2019, 1:55:06 PM4/7/19
to web2py-users
That was the word used by Massimo.
He stated
"In web2py we do not reload the modules. we reimport them at every request. this causes a performance penalty and is only needed in development."
My question was if it is possible to disable module reimport at every request in production or it just how web2py is built.

Anthony

unread,
Apr 7, 2019, 2:17:03 PM4/7/19
to web2py-users
Not sure what that means -- Massimo will have to reply. Once a module has been loaded within a given Python process, it won't be repeatedly reloaded -- see https://docs.python.org/3/reference/import.html#the-module-cache. web2py model and controller files are executed on every request -- if they import a module, there will be a very small performance hit to look up the module in sys.modules on each request (trivial relative to the cost of initializing the module on the very first request), but given web2py's execution model, there is nothing you will do to eliminate that.

Anthony
Reply all
Reply to author
Forward
0 new messages