Web3py

1,826 views
Skip to first unread message

En Ware

unread,
Apr 11, 2019, 1:31:29 PM4/11/19
to web...@googlegroups.com
I git installed web3py and quite enjoy it. I see its updated regular too. 

For those who don't know and maybe this is common sense , not sure. 

once you git clone https://github.com/web2py/web3py.git  do a git pull

2. reinstall requirements.txt (pip3 install -r requirements.txt
 - Changes:  module "reloader" was added 

3. Launch web3py (should work just fine now) 
 python3 web3py.py applications/todo/

4. open browser and type:  localhost:8000 or 127.0.0.1:8000/todo/index

Massimo Di Pierro

unread,
Apr 12, 2019, 12:03:29 AM4/12/19
to web2py-users
There is a lot to do but at this point it is moving fast and a one way street.

Kevin Keller

unread,
Apr 12, 2019, 7:40:51 AM4/12/19
to web2py-users
Any thoughts on merging / collaborating with weppy?


Uses web2py dal and yatl..
and has some nifty things to make queries and modelling easier..



--
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.

En Ware

unread,
Apr 12, 2019, 9:53:57 AM4/12/19
to web2py-users
I'm trying to wrap my ahead around how web3py works by looking at the source 

I see __init__.py is the main code for the actually todo app. 

Is this going to be the case for all applications ? or is this just for a sample ? 

Massimo Di Pierro

unread,
Apr 12, 2019, 11:29:21 AM4/12/19
to web2py-users
In web3py an application is a folder, for example "myapp". It must have:

applications/
  myapp/
    __init__.py
    templates/
    static/
    databases/

otherwise the structure is free. You are free to create models/ and controllers/ and organize code like in the old web2py but the entry point is __init__.py. Web3py will see functions defined in __init_ or imported by init. In my examples I defined all actions in __init__. For example

In __init__.py =============
from . import models
from . import controllers

In model.py =============
from web3py import DAL, Field
db = DAL('sqlite://test')
db.define_table('thing', Field('name'))

In controllers.py =============
from web3py import action, request, redirect, abort
from . models import db
@action('helloworld') # exposes http://127.0.0.1:8000/myapp/helloworld
@action.uses(db, 'helloworld.html')
def helloworld(): return dict(name=request.forms.get('name', 'visitor'))

In templates/helloworld.html =============
[[extend 'layout.html']]
<h1>Hello Dear [[=name]]</h1>

In templates/layout.html =============
<html><body>[[include]]</body></html>


request, redirect, abort are Bottely objects
DAL, Field are web2py's
the template is the same as web2py but defaults to [[ ]] delimiters to avoid conflicts with vue.js and other js
the @action decorator accepts the same parameters as bottle.route but does a little more.
There is also a form.py that implements Form() a drop in replacement (to be tested) for SQLFORM.

Notice we do all of this in 300 lines of python code and 10x faster than web2py in my tests.

Working on admin and appadmin. May be done in one week.

Massimo

Massimo Di Pierro

unread,
Apr 12, 2019, 11:32:52 AM4/12/19
to web2py-users
May steel some ideas from weppy but I do not want an ORM. That can be optional if you like we can isolate it in a module.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.

Carlos Cesar Caballero Díaz

unread,
Apr 12, 2019, 12:30:54 PM4/12/19
to web...@googlegroups.com

I reaaaaaaly would like to use an ORM with web3py, in my opinion ORMs are better for organization when apps grow big and I like a lot the fat models and thin controllers approach, and it is some messy with pydal right now (https://github.com/Medisur/journalmanagement/blob/master/models/citation.py). I have isoleted the weppy ORM some days ago (as hobby), it's not fully tested, and will need some refactoring, but if you are interested I can share it.

Greetings.

El 12/4/19 a las 11:32 a.m., Massimo Di Pierro escribió:
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

En Ware

unread,
Apr 12, 2019, 12:46:06 PM4/12/19
to web2py-users
Not getting examples to work is /examples/form or examples ? 

Kevin Keller

unread,
Apr 12, 2019, 12:55:17 PM4/12/19
to web2py-users
I'm interestes in the orm Carlos.


Happy to test it but also work on it with you. 



Massimo Di Pierro

unread,
Apr 12, 2019, 4:33:54 PM4/12/19
to web2py-users
Can you make it a module on pypi? Or should we include it in pydal?

Kevin Keller

unread,
Apr 13, 2019, 4:20:17 AM4/13/19
to web2py-users
Geat progress Massimo.

Looks awesome!

I take it we stick to bottle then and embrace vue.js as the default frontend of choice.

I suppose on the long run we just have to think about some standard glue code generation that also works with Auth and jwt on the rest endpoints. Possibly swagger / openapi auto Generation as a plus. 


Wish I would not be such a noob at coding but maybe I can look into some of it. 



On Fri, 12 Apr 2019, 22:34 Massimo Di Pierro, <massimo....@gmail.com> wrote:
Can you make it a module on pypi? Or should we include it in pydal?

黄祥

unread,
Apr 13, 2019, 5:39:27 AM4/13/19
to web2py-users
perhaps can learn the concept from popphp, seems make it modular e.g.
pop-form
pop-auth
etc ...
ref:

just an idea : 
web2py decomposed into small module with css or frontend agnostic that work only in python3 = web3py

best regards,
stifan

黄祥

unread,
Apr 13, 2019, 5:58:46 AM4/13/19
to web2py-users
test the latest commit
$ python web3py.py applications/
Traceback (most recent call last):
  File "web3py.py", line 438, in import_apps
    module = importlib.import_module(app_name)
  File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/sugizo/project/python/web3py/applications/examples/__init__.py", line 3, in <module>
    from pydal.validators import IS_NOT_EMPTY, IS_INT_IN_RANGE
  File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/reloader.py", line 158, in _import
    base = _baseimport(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'pydal.validators'

trying to access change 
web3py/applications/myapp/controllers.py
def helloworld(): return dict(name=request.forms.get('name', 'visitor')) # change visitor into another value e.g. guest, ended must restart server to take effect in browser http://localhost:8000/myapp/helloworld, is it normal ?
in another thread (web3py again) report about new app created must restart server, in this test, the app called myapp already loaded in web server, just change the value, must restart the server too, not sure if this acceptable behaviour

cant access 

thx n best regards,
stifan

Massimo Di Pierro

unread,
Apr 13, 2019, 11:48:21 AM4/13/19
to web2py-users
You say "web2py decomposed into small module with css or frontend agnostic that work only in python3 = web3py"

yes. that is the idea.

The example apps that come with it are not going to be frontend agnostic.

Massimo Di Pierro

unread,
Apr 13, 2019, 11:49:30 AM4/13/19
to web2py-users
You have an old version of pydal. The new pydal may not be on pypi, may need to get it from gitbub. I will post it on pypi over the week-end

黄祥

unread,
Apr 13, 2019, 8:59:59 PM4/13/19
to web2py-users
perhaps it related with pydal is not released yet on pypi, btw, this is the step i took to reproduce the traceback above
rm -rf ~/learn/python/web3py
cd
~/learn/python
git clone https
://github.com/web2py/web3py
source activate python3_test
cd
~/learn/python/web3py
pip install -r requirements.txt
python web3py
.py applications/
open http
://localhost:8000/todo/index

the bolt command should updated the pydal, isn't it ? or should i run it with 
pip install -U -r requirements.txt

no worries for scaffolding app that come with css or frontend embeded, what i mean of agnostic is something like sqlform or sqlform.grid(). the sqlform.grid() is great to help build web app faster, but not flexible because glued with only bootstrap framework, perhaps if you can make it work with another frontend framework, that would be nice to have.

best regards,
stifan

黄祥

unread,
Apr 14, 2019, 5:12:46 AM4/14/19
to web2py-users
test latest commit on docker because seen the Makefile in there
docker pull ubuntu
docker run
-it --privileged ubuntu /bin/bash

apt update
apt install
-y git python3-pip
git clone https
://github.com/web2py/web3py
cd web3py
pip3 install
-r requirements.txt
# ./web3py-start applications/

Traceback (most recent call last):

 
File "./web3py-start", line 5, in <module>
   
for filename in os.listdir('site-packages'):
FileNotFoundError: [Errno 2] No such file or directory: 'site-packages'

commenting this one is work
web3py/web3py-start
"""
import sys, os
for filename in os.listdir('site-packages'):
    sys.path.insert(0, os.path.join('site-packages', filename))
"""

cant access
http://localhost:8000/examples/oops # return 404
worked

http://localhost:8000/examples/showme
form input appears seems have no function on there

best regards,
stifan

Massimo Di Pierro

unread,
Apr 14, 2019, 7:34:32 PM4/14/19
to web2py-users
I moved it.

/todo/index is the only functional app
The other examples are not really designed to do do anything interesting yet.

黄祥

unread,
Apr 14, 2019, 8:10:08 PM4/14/19
to web2py-users
docker pull ubuntu
docker run
-it --privileged ubuntu /bin/bash

apt update
apt install
-y git python3-pip make
git clone https
://github.com/web2py/web3py
cd web3py
make
make install
# ./web3py-start applications/
Traceback (most recent call last):

 
File "./web3py-start", line 3, in <module>
   
from web3py.core import main
 
File "/web3py/web3py/__init__.py", line 1, in <module>
   
from . core import render, DAL, Field, action, request, response, redirect, abort, HTTP, Session, Cache, user_in
 
File "/web3py/web3py/core.py", line 39, in <module>
   
import jwt    # pip import PyJWT
ModuleNotFoundError: No module named 'jwt'

python3 setup.py install
# ./web3py-start applications/
Traceback (most recent call last):

 
File "./web3py-start", line 3, in <module>
   
from web3py.core import main
 
File "/web3py/web3py/__init__.py", line 1, in <module>
   
from . core import render, DAL, Field, action, request, response, redirect, abort, HTTP, Session, Cache, user_in
 
File "/web3py/web3py/core.py", line 39, in <module>
   
import jwt    # pip import PyJWT
ModuleNotFoundError: No module named 'jwt'

seems Makefile and setup.py not working yet, installed dependencies should using pip3 install -r requirements.txt

also in the thread '50x performance improvement for web2py in TechEmpower Web Framework Benchmarks', wondering web3py (which 10-20x faster) compare to the optimized web2py (50x performance improved) on techempower benchmarks. perhaps can learn from that code.
ref:

best regards,
stifan

黄祥

unread,
Apr 14, 2019, 8:42:29 PM4/14/19
to web2py-users
test work for Makefile and setup.py
web3py/setup.py
    install_requires=[
       
'bottle',
       
'gunicorn',
       
'gevent',
       
'pydal3',
       
'pyjwt',
       
'yatl',
       
'reloader',
       
],

best regards,
stifan

Massimo Di Pierro

unread,
Apr 14, 2019, 10:07:02 PM4/14/19
to web2py-users
hanks. fixed.t

黄祥

unread,
Apr 15, 2019, 1:11:26 AM4/15/19
to web2py-users
test dockerfile provided on web3py
1st attempt from github (not worked)
git clone https://github.com/web2py/web3py
cd web3py
/docker
docker build
-t test/web3py_git .
docker run
-d \
 
-p 8000:8000 \
 
--name web3py_git \
 test
/web3py_git
$ docker ps
-a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                  PORTS               NAMES
4b7691de9843        test/web3py_git     "web3py-start applic…"   13 seconds ago      Exited (1) 11 seconds ago                       web3py_git

note
container is dead few seconds after it's run

2nd attempt manually created (not worked)
mkdir -p app/applications
cat
<< EOF > app/requirements.txt
pyjwt
bottle
gunicorn
gevent
reloader
pydal3
yatl
web3py
EOF
cat
<< EOF > Dockerfile
FROM python
:3.7

ADD app
/app
WORKDIR
/app

RUN pip install
-r requirements.txt

CMD
["web3py-start", "applications"]
EOF
docker build
-t test/web3py_man .
docker run
-d \
 
-p 8000:8000 \
 
--name web3py_man \
 test
/web3py_man
$ docker ps
-a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS          PORTS                    NAMES
41a2fa82eed5        test/web3py_man     "web3py-start applic…"   13 seconds ago      Up 11 seconds       0.0.0.0:8000->8000/tcp   web3py_man

note
container can run, but can't access the web app todo/index

3rd attempt manually created my own cook (not worked)
cat << EOF > Dockerfile
FROM ubuntu
:latest

RUN apt update
&& \
 apt install
-y git python3-pip && \
 cd
/ && \
 git clone https
://github.com/web2py/web3py && \
 cd web3py
&& \
 pip3 install
-r requirements.txt

WORKDIR
/web3py

EXPOSE
8000

CMD python3
/web3py/web3py-start /web3py/applications/
EOF
docker build
-t test/web3py_cook .
docker run
-d \
 
-p 8000:8000 \
 
--name web3py_cook \
 test
/web3py_cook
$ docker ps
-a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS          PORTS                    NAMES
ad85f10d5767        test
/web3py_cook    "/bin/sh -c 'python3…"   15 seconds ago      Up 13 seconds       0.0.0.0:8000->8000/tcp   web3py_cook

note
container can run, but can't access the web app todo/index, the strange things bout 3rd attempt, it works well when tested interactively (the same step) via
docker run -it --privileged ubuntu /bin/bash

best regards,
stifan

黄祥

unread,
Apr 15, 2019, 5:45:26 AM4/15/19
to web2py-users
web3py/web3py/core.py
def start_server(args):
    host
, port = args.address.split(':')
   
if args.number_workers < 1:
        bottle
.run(host=host, port=int(port))
   
else:
       
if not gunicorn:
            logging
.error('gunicorn not installed')
        elif not gunicorn:
       
# should be (not sure, untested)
       
#elif not gevent:

            logging
.error('gevent not installed')
       
else:
            bottle
.run(server='gunicorn', host=host, port=int(port),
                       workers
=args.number_workers, worker_class='gevent', reloader=True,
                       certfile
=args.ssl_cert_filename, keyfile=args.ssl_key_filename)

best regards,
stifan

黄祥

unread,
Apr 15, 2019, 6:10:02 AM4/15/19
to web2py-users
web3py/applications/myapp/controllers.py
def helloworld(): return dict(name=request.forms.get('name', 'visitor'))
change 'visitor' with whatever string value, require restart web server to update the new value

web3py/applications/myapp/templates/helloworld.html
<h1>Hello Dear [[=name]]</h1>
change Hello or Dear with whatever string value, doesn't need to restart web server, just refresh the browser it will updated the value

not sure what's going on, even clean the cache browser, can't make the controller change it's updated value 'visitor'

best regards,
stifan

JorgeH

unread,
Apr 15, 2019, 9:51:05 AM4/15/19
to web2py-users
looks promising!!

JorgeH

unread,
Apr 15, 2019, 10:54:01 AM4/15/19
to web2py-users
Would it be Async??

En Ware

unread,
Apr 15, 2019, 10:58:49 AM4/15/19
to web...@googlegroups.com
It's looking very good. 

I like the new start-web3py script and updated pydal versions

Screen Shot 2019-04-15 at 9.49.10 AM.png

En Ware

unread,
Apr 15, 2019, 11:25:02 AM4/15/19
to web2py-users
from pydal._compat import StringIO, integer_types, basestring, unicodeT, urllib_unquote, \
ImportError: cannot import name 'unicodeT'

I looked at pydal __compat and unicodeT is there 

En Ware

unread,
Apr 15, 2019, 11:38:45 AM4/15/19
to web2py-users
Is this the newest version for pydal3 ? 

pydal3 (19.4)  - a pure Python Database Abstraction Layer (for python version 2.7 and 3.x)
  INSTALLED: 19.4 (latest) , Not seeing a change log in the repo. 

黄祥

unread,
Apr 15, 2019, 5:23:35 PM4/15/19
to web2py-users
added parameter for logging the app or server would be nice in web3py-start, problem found is when try to analyze the root cause during the test in docker. checked in docker logs, there is no logs, when try the interactively inside web3py folder and /var/log/ there is none of the log tell about what's going on happen.

best regards,
stifan

Massimo Di Pierro

unread,
Apr 16, 2019, 1:56:12 AM4/16/19
to web2py-users
we had a mismanagement. today pydal3 is the latest. Tomorrow I will kill pydal and deploy the latest as pydal.

Massimo Di Pierro

unread,
Apr 16, 2019, 1:56:55 AM4/16/19
to web2py-users
sorry. Have not tested docker-compose yet. If you can help fix this would be great.

Massimo Di Pierro

unread,
Apr 16, 2019, 2:46:51 AM4/16/19
to web2py-users
The http://localhost:8000/dashboard needs some love. It is very crude.
Click on the spinning thing to reload the app when editing it.

黄祥

unread,
Apr 16, 2019, 4:50:00 AM4/16/19
to web2py-users
nice dashboard, only myapp can work from dashboard link
some strange behaviour, when accessing dashboard (without index), it automatic add dashboard/static/index.html, while for another web app is not, must add index manually.

sorry forgot to test about docker-compose (not work either, guess the problem is on web server side, hard to trace because no log provided yet both on web3py folder or in /var/log/)
git clone https://github.com/web2py/web3py
cd web3py
/
docker
docker
-compose up -d
$ docker
-compose ps
     
Name                     Command              State            Ports
-----------------------------------------------------------------------------------
docker_postgres_1   docker
-entrypoint.sh postgres   Up       0.0.0.0:5432->5432/tcp
docker_web_1        web3py
-start applications       Exit 1

best regards,
stifan

黄祥

unread,
Apr 16, 2019, 8:31:02 AM4/16/19
to web2py-users
after learn the code web3py/web3py/core.py
python3 /web3py/web3py-start /web3py/applications/ is automatically run the address 127.0.0.1:8000
so the correct one to make it run on docker should use :
python3 /web3py/web3py-start /web3py/applications/ --address 0.0.0.0:8000

think there are two options
first change the default address on core.py
from
parser.add_argument('--address', default='127.0.0.1:8000',help='serving address')

into
parser.add_argument('--address', default='0.0.0.0:8000',help='serving address')

or second choice
change the CMD path for docker and add the parameter address
python3 /web3py/web3py-start /web3py/applications/ --address 0.0.0.0:8000

so Dockerfile tested work
cat << EOF > Dockerfile
FROM ubuntu
:latest

RUN apt update
&& \
 apt install
-y git python3-pip && \
 cd
/ && \
 git clone https
://github.com/web2py/web3py && \
 cd web3py
&& \
 pip3 install
-r requirements.txt

WORKDIR
/
web3py

CMD python3
/web3py/web3py-start /web3py/applications/ --address 0.0.0.0:8000

EXPOSE
8000


EOF
docker build
-t test/web3py_cook .
docker run
-d \
 
-p 8000:8000 \
 
--name web3py_cook \
 test
/
web3py_cook
docker ps
-a

for docker image base, python image base take > 200 mb while another os < 100 mb, your choice.

best regards,
stifan

En Ware

unread,
Apr 16, 2019, 9:41:50 AM4/16/19
to web2py-users
Getting error 

|  ____/ / / ____/ __ |/___ \/ __ \ \/ /
| |     / / /_  / /_/ /___/ / /_/ /\  /
| | /| / / __/ / __  //__  / ____/ / /
| |/ |/ / /___/ /_/ /___/ / / ____/ /
|___/|_/_____/_____/_____/_/ /_____/
It is still experimental...

Traceback (most recent call last):
  File "/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/web3py/web3py/core.py", line 438, in import_apps
    module = importlib.import_module(app_name)
  File "/Users/aaronm/.pyenv/versions/3.6.4/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/web3py/applications/examples/__init__.py", line 4, in <module>
    from pydal.validators import IS_NOT_EMPTY, IS_INT_IN_RANGE
  File "/Users/aaronm/.pyenv/versions/web3py/lib/python3.6/site-packages/reloader.py", line 158, in _import
    base = _baseimport(name, globals, locals, fromlist, level)
  File "/Users/aaronm/.pyenv/versions/web3py/lib/python3.6/site-packages/pydal/validators.py", line 31, in <module>
    from pydal._compat import StringIO, integer_types, basestring, unicodeT, urllib_unquote, \
ImportError: cannot import name 'unicodeT'

António Ramos

unread,
Apr 16, 2019, 11:02:46 AM4/16/19
to web...@googlegroups.com
Not working...

image.png

--
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.

En Ware

unread,
Apr 16, 2019, 1:51:13 PM4/16/19
to web2py-users
Is web3py running ? Do you see this in your terminal ? 

Bottle v0.12.16 server starting up (using WSGIRefServer())...
Hit Ctrl-C to quit.

Have you git pulled the latest changes ? 

How did you start web3py server ? 
Not working...

image.png

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

黄祥

unread,
Apr 16, 2019, 2:09:56 PM4/16/19
to web2py-users
pls provide the environment and the step to reproduce the error ?
tested run well on ubuntu python 3.6 and mac python 3.7 miniconda

best regards,
stifan

Massimo Di Pierro

unread,
Apr 16, 2019, 3:42:40 PM4/16/19
to web2py-users
You have an old pydal. Do

pip3 install --upgrade pydal

Also do

python3 web3py.py applications

Not

python3 web3py.py applications/todo/

En Ware

unread,
Apr 16, 2019, 4:32:33 PM4/16/19
to web2py-users
Thank you , that did it.

António Ramos

unread,
Apr 17, 2019, 4:38:15 AM4/17/19
to web...@googlegroups.com
Worked for me...


--
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.

António Ramos

unread,
Apr 17, 2019, 5:17:49 AM4/17/19
to web...@googlegroups.com
Massimo , any reason you chose Bulma instead of vuetify ?
Vuetify is designed specifically for vuejs 
Regards
António

António Ramos

unread,
Apr 17, 2019, 5:39:15 AM4/17/19
to web...@googlegroups.com
How to use vue devtools?
Vue.js is detected on this page. Devtools inspection is not available because it's in production mode or explicitly disabled by the author. 

António Ramos

unread,
Apr 17, 2019, 6:38:57 AM4/17/19
to web...@googlegroups.com
found it 
    self.start = function() {
        Vue.config.devtools = true;
        self.vue = new Vue({el: '#vue', data: self.data, methods: self.methods, filters: self.filters});
       
        self.on_load();
    };

Massimo Di Pierro

unread,
Apr 18, 2019, 12:31:48 AM4/18/19
to web2py-users
Ignorance on my side. If you want to make a PR switching to vuetify I will accept it.
Worked for me...


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

William

unread,
Apr 18, 2019, 5:18:13 AM4/18/19
to web2py-users
Just a note, the brand name Web3py is also used by another application and is the top result if you google for "web3py". 

Kevin Keller

unread,
Apr 18, 2019, 7:26:59 AM4/18/19
to web2py-users
Yeah saw that too.

I agree it's worthwhile to go for a different name eventually.

Carlos Cesar Caballero Díaz

unread,
Apr 18, 2019, 6:48:09 PM4/18/19
to web...@googlegroups.com
Hi Massimo, here is it: https://github.com/cccaballero/pydal-orm. I
think including something like this with pydal will be a really good
improvement.

Greetings.

El 12/4/19 a las 4:33 p.m., Massimo Di Pierro escribió:
> Can you make it a module on pypi? Or should we include it in pydal?
>

Dave S

unread,
Apr 19, 2019, 2:44:31 AM4/19/19
to web2py-users
On Thursday, April 18, 2019 at 3:48:09 PM UTC-7, Carlos Cesar Caballero wrote:
Hi Massimo, here is it: https://github.com/cccaballero/pydal-orm. I
think including something like this with pydal will be a really good
improvement.

Greetings.


As someone who had some SQL training (but not proficiency) before  using Web2Py,
and who has rarely had an issue with using the DAL (but then, I don't have complicated projects, either),
I could use some info on what makes an ORM great.

I know that Massimo has said in the past that it was a deliberate choice to do the DAL instead of an ORM
(is the DAL a DAO?),
and I see the contributors to Wikipedia have listed some concerns
along with the advantages
(client code gets to stick with working with objects ++
 high level of abstraction obscures what is happening --
 heavy reliance on ORM cited as major factor in poorly designed DBs --)

The third approach appears to be OODBMS where the store actually is built around objects via ODMs
rather than translating tables.  This gets into NoSQL territory, it seems.

So, educate me!

/dps

Carlos Cesar Caballero Díaz

unread,
Apr 19, 2019, 10:54:11 AM4/19/19
to web...@googlegroups.com

As almost everything in our world ORMs has advantages and disadvantages. The main criticism about ORMs is that they are leaky abstractions, that means they leaks details that it is supposed to abstract away, because there are times when you just need to use, for example, SQL directly or work with raw rows when making complex queries or improving performance because that is one of the ORMs disadvantages, they include an extra logical layer that, depending on the implementation can affect performance more or less.

But there are lot of people out there using ORMs and this is because they have advantages, compared with PyDAL, mostly when you are using big models, for example, compare this PyDAL model:

    def _get_somethig_plus_age(row, extra):
        return row.person.age + extra

    db.define_table('person',
        Field('name')
        Field('age', 'integer')
        Field.Method('get_somethig_plus_age', _get_somethig_plus_age)
    )

against this ORM-style model:

    class Person(Model):
        name = Field()
        age = Field('integer')

        def get_somethig_plus_age(self, extra):
            return self.age + extra

In an ORM, a model class represents a table, and when you query the DB, you get the class instance objects representing rows. Using this approach you can directly benefit from the advantages of the OOP and the code readability and organization improves a lot, mostly when models starts grow big.

Greetings.


El 19/4/19 a las 2:44 a.m., Dave S escribió:
--
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.

José Luis Redrejo

unread,
Apr 19, 2019, 3:32:40 PM4/19/19
to web...@googlegroups.com
I think one of the reasons web2py is so productive and has an easy learn curve is due to the fact of using DAL instead of an ORM.
I don't see any problem in using sqlalchemy with web2py if an ORM is needed.  I would probably use it in some big projects for some of the models.

But for the sake of the easy learning/productivity/quick development time I would prefer to keep pydal as the default, at least for the features web2py provides (auth, security, etc.)
Just my 20 cents.
José L.

Anthony

unread,
Apr 19, 2019, 4:17:39 PM4/19/19
to web2py-users
On Friday, April 19, 2019 at 10:54:11 AM UTC-4, Carlos Cesar Caballero wrote:

As almost everything in our world ORMs has advantages and disadvantages. The main criticism about ORMs is that they are leaky abstractions, that means they leaks details that it is supposed to abstract away, because there are times when you just need to use, for example, SQL directly or work with raw rows when making complex queries or improving performance because that is one of the ORMs disadvantages, they include an extra logical layer that, depending on the implementation can affect performance more or less.

But there are lot of people out there using ORMs and this is because they have advantages, compared with PyDAL, mostly when you are using big models, for example, compare this PyDAL model:

    def _get_somethig_plus_age(row, extra):
        return row.person.age + extra

    db.define_table('person',
        Field('name')
        Field('age', 'integer')
        Field.Method('get_somethig_plus_age', _get_somethig_plus_age)
    )

against this ORM-style model:

    class Person(Model):
        name = Field()
        age = Field('integer')

        def get_somethig_plus_age(self, extra):
            return self.age + extra

In an ORM, a model class represents a table, and when you query the DB, you get the class instance objects representing rows. Using this approach you can directly benefit from the advantages of the OOP and the code readability and organization improves a lot, mostly when models starts grow big.


In the case of the weppy ORM in particular, though, I think it really is just alternative syntax for everything that can already be done via pyDAL, typically with the same number of lines of code (note, the above examples would have the same number of lines if you added the @rowattr('get_something_plus_age') decorator required by weppy to the instance method).

Anthony

Anthony

unread,
Apr 19, 2019, 4:22:08 PM4/19/19
to web2py-users
On Thursday, April 18, 2019 at 6:48:09 PM UTC-4, Carlos Cesar Caballero wrote:
Hi Massimo, here is it: https://github.com/cccaballero/pydal-orm. I
think including something like this with pydal will be a really good
improvement.

My only concern is whether the benefits are worth having to adopt all that new code (and update it when changes are made to pyDAL). Maybe it should remain an external package rather than being folded into pyDAL.

Anthony

Carlos Cesar Caballero Díaz

unread,
Apr 19, 2019, 5:47:31 PM4/19/19
to web...@googlegroups.com

Yes, but that's not about the number of code lines, that's about the code organization and readability.

Greetings.

El 19/4/19 a las 4:17 p.m., Anthony escribió:

Carlos Cesar Caballero Díaz

unread,
Apr 19, 2019, 6:41:34 PM4/19/19
to web...@googlegroups.com

Well, that's a really fair concern, I was just mentioning, because I like ORMs and other popular projects like SQLAlchemy includes a DAL (they call it SQL abstraction toolkit) and an ORM on top of it, and if you look at popular web development full stack frameworks, almost all of them are relaying their models to ORMs.

Greetings

El 19/4/19 a las 4:22 p.m., Anthony escribió:

黄祥

unread,
Apr 20, 2019, 5:22:27 AM4/20/19
to web2py-users
github latest commit
access via browser 
on console
127.0.0.1 - - [20/Apr/2019 16:17:21] "GET /dashboard HTTP/1.1" 303 0
127.0.0.1 - - [20/Apr/2019 16:17:21] "GET /_dashboard/static/index.html HTTP/1.1" 404 460
127.0.0.1 - - [20/Apr/2019 16:17:26] "GET /_dashboard HTTP/1.1" 404 460

best regards,
stifan

villas

unread,
Apr 20, 2019, 8:16:39 AM4/20/19
to web2py-users
I've just been playing with web3py and I think it's great!  This framework seems so much cleaner and I like the Bottle routes etc.

Re: Dashboard. Currently broken, but I guess Massimo is still working on this and committed prematurely.

Re: ORM.  It feels like we are talking about the icing before the cake has been mixed. Hopefully any ORM would just be a plug-in option rather than weighing down our fantastic DAL.

Re: Auth.  This seems a much more important topic because I'm not going to bother making any app until I know how to secure it. This is one feature of web2py that is vital.  I'm really hoping too that any auth would include 'roles' because 'authorization' depends on that. I hope this will attract more comments.

Re: Form. I know that we want to be agnostic, but there seems little harm to include basic styling classes. Could this be taken from a config file?  Maybe Vuetify would be better than Bootstrap?

Re: Grid.  I use SQLFORM.grid for prototyping,  but I then I so often find myself replacing that code with Datatables. Shouldn't we just include Datatables?  It has everything we need - doesn't it?

Thanks to Massimo and others for making this great progress for our community!

Massimo Di Pierro

unread,
Apr 20, 2019, 11:32:10 AM4/20/19
to web2py-users
web2.py existed before web2py and did not hurt us.
web3py existed before web3.py and in fact I own the domain name. It will not hurt us either.

I am more concerned by the confusion between web2py for python 3 vs web3py.
I am thinking it should have two names "web3py XYZ" where XYZ is t.b.d.

黄祥

unread,
Apr 20, 2019, 4:45:55 PM4/20/19
to web2py-users
is it on same situation web2py for python 3 vs web3py
with
laravel vs lumen
?
the first is full stack web framework, while the other is micro web framework

best regards,
stifan

Jacinto Parga

unread,
Apr 20, 2019, 5:44:39 PM4/20/19
to web2py-users
So, if you plan to move your web services developed with web2py python 2.7 to python 3 and deploy new micro services, what would be the best choice to try?
 - web2py for python 3
 - web3py
 
 Let's suppose one year term

Anthony

unread,
Apr 20, 2019, 7:12:40 PM4/20/19
to web2py-users
On Friday, April 19, 2019 at 5:47:31 PM UTC-4, Carlos Cesar Caballero wrote:

Yes, but that's not about the number of code lines, that's about the code organization and readability.


At least with the example given, I don't see a lot of difference in organization or readability (particularly not enough to warrant introduction of the ORM codebase as well as the confusion that can come with having multiple ways to do the same thing).

Anthony

Anthony

unread,
Apr 20, 2019, 7:49:31 PM4/20/19
to web2py-users
On Friday, April 19, 2019 at 6:41:34 PM UTC-4, Carlos Cesar Caballero wrote:

Well, that's a really fair concern, I was just mentioning, because I like ORMs and other popular projects like SQLAlchemy includes a DAL (they call it SQL abstraction toolkit) and an ORM on top of it, and if you look at popular web development full stack frameworks, almost all of them are relaying their models to ORMs.


The SQLAlchemy ORM adds a lot of functionality that is not available with its DAL alone, and most of that extra functionality already exists in pyDAL. As far as I can tell, the weppy ORM does not really add any functionality to the DAL -- it is mostly an alternative syntax. I'm not saying there isn't value there, just that it is a lot of code maintenance to take on for maybe only a very modest benefit.

Anthony

Massimo Di Pierro

unread,
Apr 20, 2019, 8:03:41 PM4/20/19
to web2py-users
If you made use of SQLHTML forms and grid and simply want to move from python2 to python3, than stick with web2py.

If you want to use the DAL and maybe web2py templates but your app is (or will be) using mostly API driven then use web3py.

web3py already supports tickets (like web2py), pydal, yatl, helpers (almost identical to web2py), multi app (applications folder), and will soon have a functioning _dashboard (with similar functionalities to web2py's admin+appadmin). You will be able to develop and deploy and manage apps very much like you do in web2py. What we will not do, is encourage the use of server side rendering of forms and grids with postbacks logic that web2py has. We will instead create more tools to make API based apps easier to build with minimal JS programming. web3py will be less opinionated on the server but more opinionated on the client. It will not force you to use any client specific JS but default apps will ship with vue.js and examples based on vue.js.

The goal is the same "make web development easy and enforce good practices" but the web has changed since 2007, when web2py was designed.

Massimo

Massimo Di Pierro

unread,
Apr 20, 2019, 8:25:01 PM4/20/19
to web2py-users
I have been looking more into veutify. I have some reservations.
I think a good CSS framework (for web3py) should be JS agnostic, even if the examples use vue.js.
I think effects should be done in CSS only, not in JS. vuetify does not follow this rule.
Also vuetify is really designed for use with the CLI and I would like web3py to remain CLI agnostic.
Documentation is not good yet.
I think I will stick to bulma for now for the simplest example apps and dashboard.

For mobile app style, I like Framework7 a lot.

Massimo

黄祥

unread,
Apr 20, 2019, 9:03:44 PM4/20/19
to web2py-users
scaffolding app would be nice to have example of authentication (user registration, login and logout) and to update the data, e.g. update todo list on todo app
just wondering, if form used manually using javascript, is the field validation on pydal, still can work ? e.g. requires=IS_NOT_EMPTY()

best regards,
stifan

Kevin Keller

unread,
Apr 21, 2019, 5:06:05 AM4/21/19
to web2py-users
Authentication + authorization and documentation of endpoints are actually the hardest part.

There is a. Flask based framework called connexxion which asks you to create the openapi spec before the code which has jwt and oauth2 build in as. Well. 


Then there are flask Rebar which can use jwt and auth0 build in . Also gernatrss openapi 2 documentation.

And there is Sars., also a Flask based framework thst generates openapi 2 documentation and can easily extend with jwt and oauth2 via flask plug-ins.

There is also hug, based on the falcon framework.. Also generates openapi v2 documentation and has an oauth2 plugin and does jwt build in. 

Thus I was thinking to bring up this topic early. 

Bottle does not have this kind of out of the box suopport, but there is a framework agnostic openapi generator we could use : https://apispec.readthedocs.io/en/stable/

And we could create a oauth2 plugin for bottle (the current one is deprecated) based on authlib. 
Authlib also has the ability to generate jwt tokens, but for standalone tokens we could use pyjwt I guess. 

When we scaffold crud apis and vue frontends with authentication in place thst would be great just as it was with web2py by just using a decorator I. E. Crud api routes and functions and authentication via tokens and/or oauth2. 

The openapi makes it easy to collaborate with others in Microservice environment and also gives users the ability to generate UIs sich as with angular and react based on openapi specs Web3py generated for thr enpoints. 





--
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 21, 2019, 12:32:27 PM4/21/19
to web2py-users
I was wrong.. Found a recent integration with bottle  and oauthlib.. 

Now we only need to figure out jwt and easy rest crud.. Which bottle is perfect for and finally use the before mentioned openapi generator with bottle and we are good to go. 


黄祥

unread,
Apr 21, 2019, 4:18:52 PM4/21/19
to web2py-users
Traceback (most recent call last):
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 460, in import_apps
   
module = importlib.import_module(app_name)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/importlib/__init__.py", line 127, in import_module
   
return _bootstrap._gcd_import(name[level:], package, level)
 
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
 
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
 
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
 
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
 
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
 
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
 
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/__init__.py", line 1, in <module>
   
from . import controllers
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/reloader.py", line 158, in _import
   
base = _baseimport(name, globals, locals, fromlist, level)
 
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 3, in <module>
   
from . import models
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/reloader.py", line 158, in _import
   
base = _baseimport(name, globals, locals, fromlist, level)
 
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/models.py", line 8, in <module>
    pool_size
=settings.DB_POOL_SIZE)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/base.py", line 171, in __call__
    obj
= super(MetaDAL, cls).__call__(*args, **kwargs)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/base.py", line 477, in __init__
   
"Failure to connect, tried %d times:\n%s" % (attempts, tb)
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/base.py", line 457, in __init__
   
self._adapter = adapter(**kwargs)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/__init__.py", line 39, in __call__
    obj
= super(AdapterMeta, cls).__call__(*args, **kwargs)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/base.py", line 369, in __init__
   
super(SQLAdapter, self).__init__(*args, **kwargs)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/base.py", line 53, in __init__
   
self.reconnect()
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/connection.py", line 154, in reconnect
   
self.connection = self.connector()
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/sqlite.py", line 42, in connector
   
return self.driver.Connection(self.dbpath, **self.driver_args)
sqlite3
.OperationalError: unable to open database file

Bottle v0.12.16 server starting up (using WSGIRefServer())...
Listening on http://127.0.0.1:8000/
Hit Ctrl-C to quit.

127.0.0.1 - - [22/Apr/2019 03:08:12] "GET /dashboard HTTP/1.1" 303 0
127.0.0.1 - - [22/Apr/2019 03:08:12] "GET /_dashboard/static/index.html HTTP/1.1" 404 459
127.0.0.1 - - [22/Apr/2019 03:08:56] "GET /_dashboard/ HTTP/1.1" 404 459
127.0.0.1 - - [22/Apr/2019 03:09:31] "GET /_dashboard/dashboard HTTP/1.1" 404 459
127.0.0.1 - - [22/Apr/2019 03:09:35] "GET /_dashboard/info HTTP/1.1" 200 1111
127.0.0.1 - - [22/Apr/2019 03:09:59] "GET /_dashboard/routes HTTP/1.1" 200 2711
127.0.0.1 - - [22/Apr/2019 03:10:21] "GET /_dashboard/apps HTTP/1.1" 200 3410
127.0.0.1 - - [22/Apr/2019 03:11:00] "GET /_scaffold HTTP/1.1" 404 457
127.0.0.1 - - [22/Apr/2019 03:11:33] "GET /_scaffold/index HTTP/1.1" 404 457

step
rm -rf ~/learn/python/web3py
cd
~/learn/python
git clone https
://github.com/web2py/web3py
cd
~/learn/python/web3py
source activate python3_test
pip install
-U -r requirements.txt
python web3py
-start applications/

best regards,
stifan

Massimo Di Pierro

unread,
Apr 22, 2019, 2:23:48 AM4/22/19
to web2py-users
I will work on auth.

I could use some help with _dashboard. The "create app", "upload app" and "pack app" buttons do not work but this logic should work the same as in web2py. Should be easy to backport if somebody can help this week.

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

黄祥

unread,
Apr 22, 2019, 4:16:15 AM4/22/19
to web2py-users
solved by created the databases directory on _scaffold's folder

best regards,
stifan

黄祥

unread,
Apr 22, 2019, 8:14:07 PM4/22/19
to web2py-users
127.0.0.1 - - [22/Apr/2019 03:08:12] "GET /dashboard HTTP/1.1" 303 0
127.0.0.1 - - [22/Apr/2019 03:08:12] "GET /_dashboard/static/index.html HTTP/1.1" 404 459
127.0.0.1 - - [22/Apr/2019 03:08:56] "GET /_dashboard/ HTTP/1.1" 404 459
127.0.0.1 - - [22/Apr/2019 03:09:31] "GET /_dashboard/dashboard HTTP/1.1" 404 459
127.0.0.1 - - [22/Apr/2019 03:09:35] "GET /_dashboard/info HTTP/1.1" 200 1111</span

error in dashboard seems there is no index.html file on /_dashboard/static/index.html, which is occured in previous commit
want to help n learn, but not sure is it same to learn it from web2py/applications/admin/controllers/appadmin.py can be apply to web3py/applications/_dashboard/__init__.py ?

best regards,
stifan 

Massimo Di Pierro

unread,
Apr 23, 2019, 12:10:19 AM4/23/19
to web2py-users
my mistake. I added it.

the web2py admin is different. The web3py one is much more spartan. But the functions that need to be ported to zip/unzip apps are indentical.

黄祥

unread,
Apr 23, 2019, 11:44:26 AM4/23/19
to web2py-users
the web2py admin is different. The web3py one is much more spartan. But the functions that need to be ported to zip/unzip apps are indentical.

not sure got the meaning of spartan
tested last commit, all errors above gone (_dashboard and _scaffold)
just a note for default requirements.txt for guncorn, seems it can't run windows, is it design that way ? 
another alternatives run on windows n *nix environment : waitress or rocket (same like web2py)

ref:

best regards,
stifan 

Dave S

unread,
Apr 23, 2019, 4:07:31 PM4/23/19
to web2py-users


On Tuesday, April 23, 2019 at 8:44:26 AM UTC-7, 黄祥 wrote:
the web2py admin is different. The web3py one is much more spartan. But the functions that need to be ported to zip/unzip apps are indentical.

not sure got the meaning of spartan


"spartan", "spare", and "barebones" all have senses relating to mimimalism (in a general sense, not just Terry Riley's music) and lack of frills or extras.  "Spartan", of course, is derived from the ancient Greek nation-state, whose populatiion was encougraged to be tough, avoid excess, and be ready to bear hardship.

Massimo is saying that the web3py admin (dashboard?) has enough features to be useful, but doesn't include cupholders and leather seats.

(Both Land Rover and Land Cruiser have become much more like yachts these days.)

/dps



Scott Hunter

unread,
Apr 23, 2019, 7:52:47 PM4/23/19
to web2py-users
I followed these directions as best I could:

* There is no file named web3py.py.  There is a file web3py-start; that seemed to work
* No matter what URL I provide, I get a big red screen saying "404 Not Found"

On Thursday, April 11, 2019 at 1:31:29 PM UTC-4, En Ware wrote:
I git installed web3py and quite enjoy it. I see its updated regular too. 

For those who don't know and maybe this is common sense , not sure. 

once you git clone https://github.com/web2py/web3py.git  do a git pull

2. reinstall requirements.txt (pip3 install -r requirements.txt
 - Changes:  module "reloader" was added 

3. Launch web3py (should work just fine now) 
 python3 web3py.py applications/todo/

4. open browser and type:  localhost:8000 or 127.0.0.1:8000/todo/index

黄祥

unread,
Apr 23, 2019, 9:37:00 PM4/23/19
to web2py-users
yeah you right, pls follow this step instead (for latest commit)
git clone https://github.com/web2py/web3py
cd web3py
pip install
-U -r requirements.txt
python web3py
-start applications/

for url return 404, perhaps you can check on the applications folder, in the webapp name, you could learn from __init__.py file the url that is valid. some of __init__.py is load another module file controllers.py.
pls check at the top of the function name:
e.g. pls change examples with appname you want to access
applications/examples/__init__.py
@action('form', method=['GET','POST'])
so it means the url valid is http://localhost:8000/examples/form

best regards,
stifan

Dave S

unread,
Apr 24, 2019, 12:31:59 AM4/24/19
to web2py-users


On Tuesday, April 23, 2019 at 6:37:00 PM UTC-7, 黄祥 wrote:
yeah you right, pls follow this step instead (for latest commit)
git clone https://github.com/web2py/web3py
cd web3py
pip install
-U -r requirements.txt
python web3py
-start applications/


You may not need that last "python".
The instructions in the README.md file downgitloaded worked fine for me, and I have 2 items in the todo list.
(The default address of / 404's for me.)

/dps

Dave S

unread,
Apr 24, 2019, 12:34:41 AM4/24/19
to web2py-users


On Saturday, April 20, 2019 at 5:25:01 PM UTC-7, Massimo Di Pierro wrote:
I have been looking more into veutify. I have some reservations.
I think a good CSS framework (for web3py) should be JS agnostic, even if the examples use vue.js.
I think effects should be done in CSS only, not in JS. vuetify does not follow this rule.
Also vuetify is really designed for use with the CLI and I would like web3py to remain CLI agnostic.
Documentation is not good yet.
I think I will stick to bulma for now for the simplest example apps and dashboard.

For mobile app style, I like Framework7 a lot.

Massimo

Is stupid.css a dead end?  Too much re-inventing the wheel?

/dps
 
Worked for me...


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

Massimo Di Pierro

unread,
Apr 24, 2019, 1:26:30 AM4/24/19
to web2py-users
stupid was an experiment. the _dashboard is based on some variation of it. I do not think it good enough for what people expect from a css framework today. The collection of pure css effects in there has some value but that's all.

Massimo Di Pierro

unread,
Apr 24, 2019, 1:30:21 AM4/24/19
to web2py-users
updated instructions are here:


Notice they may change. Also notice you need python3. Won't work with python 2.

黄祥

unread,
Apr 26, 2019, 3:03:09 AM4/26/19
to web2py-users
git clone https://github.com/web2py/web3py
cd web3py
$ pip3 install
-r requirements.txt
Collecting pyjwt (from -r requirements.txt (line 1))
 
Using cached https://files.pythonhosted.org/packages/87/8b/6a9f14b5f781697e51259d81657e6048fd31a113229cf346880bb7545565/PyJWT-1.7.1-py2.py3-none-any.whl
Collecting yat (from -r requirements.txt (line 2))
 
Could not find a version that satisfies the requirement yat (from -r requirements.txt (line 2)) (from versions: )
No matching distribution found for yat (from -r requirements.txt (line 2))

previous commit seems using yatl not yat in requirements.txt

best regards,
stifan

黄祥

unread,
Apr 26, 2019, 3:16:42 AM4/26/19
to web2py-users
$ ./web3py-start applications/

Traceback (most recent call last):

 
File "./web3py-start", line 3, in <module>
   
from web3py.core import main
 
File "/Users/sugizo/learn/python/web3py/web3py/__init__.py", line 1, in <module>
   
from . core import render, DAL, Field, action, request, response, redirect, abort, HTTP, Session, Cache, user_in, Translator
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 39, in <module>
   
import jwt       # pip import PyJWT
ModuleNotFoundError: No module named 'jwt'

best regards,
stifan

Massimo Di Pierro

unread,
Apr 26, 2019, 3:28:24 AM4/26/19
to web2py-users
fixed. sorry

黄祥

unread,
Apr 27, 2019, 1:58:38 AM4/27/19
to web2py-users
latest commit still have the same error from previous commit
git clone https://github.com/web2py/web3py
cd web3py
pip3 install
-r requirements.txt
$
./web3py-start applications/

Traceback (most recent call last):
 
File "./web3py-start", line 3, in <module>
   
from web3py.core import main
 
File "/Users/sugizo/learn/python/web3py/web3py/__init__.py", line 1, in <module>

   
from . core import (
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 40, in <module>

   
import jwt       # pip import PyJWT
ModuleNotFoundError: No module named 'jwt'

best regards,
stifan

黄祥

unread,
Apr 28, 2019, 10:16:45 AM4/28/19
to web2py-users
the error above seems related to the module not installed yet, there is a different between pip and pip3 in conda environment, yet the environment already active with source activate python3_test but it still detected the conda base environment
$ pip -V
pip
19.0.3 from /Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pip (python 3.7)
$ pip3
-V
pip
19.0.3 from /Users/sugizo/miniconda3/lib/python3.6/site-packages/pip (python 3.6)

realize it with pip list or pip freeze to check the module installed, my bad

best regards,
stifan

黄祥

unread,
Apr 28, 2019, 10:26:23 AM4/28/19
to web2py-users
_scaffold/controllers.py
@action('index', method='GET')                # the function below is exposed as index.html
@action.uses('generic.html', session, db, T)  # it uses the generic.html template, a session, and the db
def index():
    T
.select('id')
    session
['counter'] = session.get('counter', 0) + 1
    msg
= T('Hello World from {name}')
   
return dict(message=msg.format(name=session['counter'] ) )

_scaffold/requirements.txt
python-memcached
redis

change the value of settings.py for session only work with cookies and database, for testing session with redis and memcache, every error occured, stop the server, change the settings.py then start the server again, refresh the page.

test redis session with password in redis.conf
ERROR:root:Traceback (most recent call last):
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 353, in wrapper
    ret
= func(*func_args, **func_kwargs)
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 321, in wrapper
   
[obj.on_request() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 321, in <listcomp>
   
[obj.on_request() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 266, in on_request
   
self.load()
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 231, in load
    json_data
= self.storage.get(cookie_data)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 1264, in get
   
return self.execute_command('GET', name)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 775, in execute_command
   
return self.parse_response(connection, command_name, **options)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 789, in parse_response
    response
= connection.read_response()
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 642, in read_response
   
raise response
redis
.exceptions.ResponseError: NOAUTH Authentication required.

id
= 2

test redis session without password in redis.conf
ERROR:root:Traceback (most recent call last):
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in wrapper
   
[obj.on_success() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in <listcomp>
   
[obj.on_success() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 274, in on_success
   
self.save()
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
   
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
 
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>
    conn
.set = lambda key, value, expire, c=conn: (c.set(key,value), c.ttl(expiration))
TypeError: <lambda>() missing 1 required positional argument: 'expire'

During handling of the above exception, another exception occurred:


Traceback (most recent call last):

 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 353, in wrapper
    ret
= func(*func_args, **func_kwargs)
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in wrapper
   
[obj.on_error() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in <listcomp>
   
[obj.on_error() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 270, in on_error
   
self.save()
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
   
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
 
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>
    conn
.set = lambda key, value, expire, c=conn: (c.set(key,value), c.ttl(expiration))
TypeError: <lambda>() missing 1 required positional argument: 'expire'

id
= 3

test memcache session
ERROR:root:Traceback (most recent call last):
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in wrapper
   
[obj.on_success() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in <listcomp>
   
[obj.on_success() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 274, in on_success
   
self.save()
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
   
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 727, in set
   
return self._set("set", key, val, time, min_compress_len, noreply)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1052, in _set
   
return _unsafe_set()
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1036, in _unsafe_set
    headers
= "%d %d %d" % (flags, time, len_val)
TypeError: %d format: a number is required, not NoneType

During handling of the above exception, another exception occurred:


Traceback (most recent call last):

 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 353, in wrapper
    ret
= func(*func_args, **func_kwargs)
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in wrapper
   
[obj.on_error() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in <listcomp>
   
[obj.on_error() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 270, in on_error
   
self.save()
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
   
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 727, in set
   
return self._set("set", key, val, time, min_compress_len, noreply)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1052, in _set
   
return _unsafe_set()
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1036, in _unsafe_set
    headers
= "%d %d %d" % (flags, time, len_val)
TypeError: %d format: a number is required, not NoneType

id
= 4

is the id on the bottom of error traceback is the id for error traceback that record in database ?

best regards,
stifan

Massimo Di Pierro

unread,
Apr 28, 2019, 3:01:44 PM4/28/19
to web2py-users
I have not tested redis and memcache therefore it is possible there is a bug in the _scaffold/controller.py code.
Thanks for checking this.
save
   
self.storage.set(cookie_data, json.dumps(self.local<span style="color: #660;" class="styled-by-p

黄祥

unread,
Apr 28, 2019, 6:41:42 PM4/28/19
to web2py-users
still got an error for store session in redis after update the _scaffold/controllers.py
...
elif settings.SESSION_TYPE == 'redis':
   
import redis
    host
, port = settings.REDIS_SERVER.split(':')
    conn
= redis.Redis(host=host, port=int(port))
   
conn.set = lambda key, value, expire, cs=conn.set, ct=conn.ttl: (cs(key,value), ct(expiration))
    session
= Session(secret=settings.SESSION_SECRET_KEY, storage=conn)
...

not tested the memcached again, since, seems it's not updated yet.

test redis session without password in redis.conf
ERROR:root:Traceback (most recent call last):
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in wrapper
   
[obj.on_success() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in <listcomp>
   
[obj.on_success() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 274, in on_success
   
self.save()
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
   
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
 
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>

    conn
.set = lambda key, value, expire, cs=conn.set, ct=conn.ttl: (cs(key,value), ct(expiration))
NameError: name 'expiration' is not defined


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 353, in wrapper
    ret
= func(*func_args, **func_kwargs)
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in wrapper
   
[obj.on_error() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in <listcomp>
   
[obj.on_error() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 270, in on_error
   
self.save()
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in
save
   
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)

 
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>

    conn
.set = lambda key, value, expire, cs=conn.set, ct=conn.ttl: (cs(key,value), ct(expiration))
NameError: name 'expiration' is not defined

id
= 6

test redis session with password in redis.conf
ERROR:root:Traceback (most recent call last):

 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in wrapper
   
[obj.on_success() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in <listcomp>
   
[obj.on_success() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 274, in on_success
   
self.save()
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
   
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
 
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>

    conn
.set = lambda key, value, expire, cs=conn.set, ct=conn.ttl: (cs(key,value), ct(expiration))
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 1451, in set
   
return self.execute_command('SET', *pieces)

 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 775, in execute_command
   
return self.parse_response(connection, command_name, **options)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 789, in parse_response
    response
= connection.read_response()
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 642, in read_response
   
raise response
redis
.exceptions.ResponseError: NOAUTH Authentication required.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 353, in wrapper
    ret
= func(*func_args, **func_kwargs)
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in wrapper
   
[obj.on_error() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in <listcomp>
   
[obj.on_error() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 270, in on_error
   
self.save()
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in
save
   
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)

 
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>

    conn
.set = lambda key, value, expire, cs=conn.set, ct=conn.ttl: (cs(key,value), ct(expiration))
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 1451, in set
   
return self.execute_command('SET', *pieces)

 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 775, in execute_command
   
return self.parse_response(connection, command_name, **options)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 789, in parse_response
    response
= connection.read_response()
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 642, in read_response
   
raise response
redis
.exceptions.ResponseError: NOAUTH Authentication required.


id
= 7

best regards,
stifan

Massimo Di Pierro

unread,
Apr 28, 2019, 9:33:58 PM4/28/19
to web2py-users
one more try?

    conn
.set = lambda key, value, expire, cs=<span style="color: #000;" clas

黄祥

unread,
Apr 28, 2019, 9:52:14 PM4/28/19
to web2py-users
still got an error, tested redis last version (source) without password, in conda environment:
$ uname
Darwin
$ python
-V
Python 3.7.3
$ pip list
Package          Version
---------------- --------  
redis            
3.2.1
$
./web3py-start applications/

ERROR
:root:Traceback (most recent call last):
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in wrapper
   
[obj.on_success() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in <listcomp>
   
[obj.on_success() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 274, in on_success
   
self.save()
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
   
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
 
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>

    conn
.set = lambda key, value, expiration, cs=conn.set, ct=conn.ttl: (cs(key, value), ct(expiration))
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 1511, in ttl
   
return self.execute_command('TTL', name)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 774, in execute_command
    connection
.send_command(*args)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 620, in send_command
   
self.send_packed_command(self.pack_command(*args))
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 663, in pack_command
   
for arg in imap(self.encoder.encode, args):
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 125, in encode
   
"byte, string or number first." % typename)
redis
.exceptions.DataError: Invalid input of type: 'NoneType'. Convert to a byte, string or number first.


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 353, in wrapper
    ret
= func(*func_args, **func_kwargs)
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in wrapper
   
[obj.on_error() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in <listcomp>
   
[obj.on_error() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 270, in on_error
   
self.save()
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
   
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
 
File "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", line 18, in <lambda>

    conn
.set = lambda key, value, expiration, cs=conn.set, ct=conn.ttl: (cs(key, value), ct(expiration))
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 1511, in ttl
   
return self.execute_command('TTL', name)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/client.py", line 774, in execute_command
    connection
.send_command(*args)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 620, in send_command
   
self.send_packed_command(self.pack_command(*args))
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 663, in pack_command
   
for arg in imap(self.encoder.encode, args):
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/redis/connection.py", line 125, in encode
   
"byte, string or number first." % typename)
redis
.exceptions.DataError: Invalid input of type: 'NoneType'. Convert to a byte, string or number first.

best regards,
stifan

黄祥

unread,
Apr 29, 2019, 1:38:04 AM4/29/19
to web2py-users
fixed for store session in redis without password
problem still exist :
- store session in redis with password on redis.conf
- store session in memcache

best regards,
stifan

黄祥

unread,
Apr 30, 2019, 6:44:26 PM4/30/19
to web2py-users
tested web3py/test return an error, detail error and step below:
docker pull ubuntu
docker run
-it --privileged ubuntu /bin/bash

apt update
apt install
-y git python3-pip
cd
git clone https
://github.com/web2py/web3py

cd web3py
pip3 install
-r requirements.
txt
pip3 install mechanize
cd web3py
/tests
root@b41c0655fd23
:~/web3py/web3py/tests# python3 test_action.py

Traceback (most recent call last):

 
File "test_action.py", line 9, in <module>
   
from web3py import action, DAL, Field, Session, Cache
ModuleNotFoundError: No module named 'web3py'
root@b41c0655fd23
:~/web3py/web3py/tests# pip3 install web3py
Collecting web3py
 
Using cached https://files.pythonhosted.org/packages/ee/a2/f57e1fefb0c62b4423fd76ea359d58d2363982054050b8c0ab54ed4b84c5/web3py-0.1.20190426.tar.gz
   
Complete output from command python setup.py egg_info:
    fatal
: not a git repository (or any of the parent directories): .git
   
Traceback (most recent call last):
     
File "<string>", line 1, in <module>
     
File "/tmp/pip-build-m4zx1t4i/web3py/setup.py", line 25, in <module>
        long_description
=__doc__ + ' (%s)' % get_hash(),
     
File "/tmp/pip-build-m4zx1t4i/web3py/setup.py", line 13, in get_hash
       
return subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip().decode('utf8')
     
File "/usr/lib/python3.6/subprocess.py", line 336, in check_output
       
**kwargs).stdout
     
File "/usr/lib/python3.6/subprocess.py", line 418, in run
        output
=stdout, stderr=stderr)
    subprocess
.CalledProcessError: Command '['git', 'rev-parse', 'HEAD']' returned non-zero exit status 128.

   
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-m4zx1t4i/web3py/

even run web3py-start in background still got the same error
cd ../..
./web3py-start applications/ &
cd web3py
/tests
root@b41c0655fd23
:~/web3py/web3py/tests# python3 test_action.py

Traceback (most recent call last):

 
File "test_action.py", line 9, in <module>
   
from web3py import action, DAL, Field, Session, Cache
ModuleNotFoundError: No module named 'web3py'

the rest of test files (web3py/tests/test_*.py) return the same error.

best regards,
stifan

黄祥

unread,
May 3, 2019, 3:21:45 AM5/3/19
to web2py-users
git clone https://github.com/web2py/web3py
cd web3py
$ pip3 install
-r requirements.txt
Collecting memcache (from -r requirements.txt (line 9))
 
Could not find a version that satisfies the requirement memcache (from -r requirements.txt (line 9)) (from versions: )
No matching distribution found for memcache (from -r requirements.txt (line 9))

should be
web3py/requirements.txt
python-memcached

best regards,
stifan

黄祥

unread,
May 3, 2019, 3:25:38 AM5/3/19
to web2py-users

ERROR:root:Traceback (most recent call last):
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 327, in wrapper
   
[obj.on_success() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 327, in <listcomp>

   
[obj.on_success() for obj in fixtures]

 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 276, in on_success
   
self.save()

 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
   
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 727, in set
   
return self._set("set", key, val, time, min_compress_len, noreply)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1052, in _set
   
return _unsafe_set()
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1036, in _unsafe_set
    headers
= "%d %d %d" % (flags, time, len_val)
TypeError: %d format: a number is required, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 355, in wrapper
    ret
= func(*func_args, **func_kwargs)
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 330, in wrapper
   
[obj.on_error() for obj in fixtures]
 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 330, in <listcomp>

   
[obj.on_error() for obj in fixtures]

 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 272, in on_error
   
self.save()

 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in save
   
self.storage.set(cookie_data, json.dumps(self.local.data), self.expiration)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 727, in set
   
return self._set("set", key, val, time, min_compress_len, noreply)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1052, in _set
   
return _unsafe_set()
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/memcache.py", line 1036, in _unsafe_set
    headers
= "%d %d %d" % (flags, time, len_val)
TypeError: %d format: a number is required, not NoneType


id
= 13

strange things the error id keeps incrementing even deleted the source before execute the new one
rm -rf web3py
git clone https
://github.com/web2py/web3py
cd web3py

best regards,
stifan

Massimo Di Pierro

unread,
May 4, 2019, 9:20:37 PM5/4/19
to web2py-users
Fixed a bunch of issues, improved the examples, and ticketed what needs to be done (not much).
I assigned some to me but I could use some help.

Massimo

jcrm...@gmail.com

unread,
May 6, 2019, 7:38:47 PM5/6/19
to web2py-users
My 2c

You could call it web2py3 with this logic
web2py was web for Python (at the time it was Python 2.x)
web2py3 will the web for Python 3.


sábado, 20 de Abril de 2019 às 16:32:10 UTC+1, Massimo Di Pierro escreveu:
web2.py existed before web2py and did not hurt us.
web3py existed before web3.py and in fact I own the domain name. It will not hurt us either.

I am more concerned by the confusion between web2py for python 3 vs web3py.
I am thinking it should have two names "web3py XYZ" where XYZ is t.b.d.

On Thursday, 18 April 2019 04:26:59 UTC-7, Kevin Keller wrote:
Yeah saw that too.

I agree it's worthwhile to go for a different name eventually.

Daniel

unread,
May 8, 2019, 5:00:43 PM5/8/19
to web2py-users


El lunes, 6 de mayo de 2019, 19:38:47 (UTC-4), jcrm...@gmail.com escribió:
My 2c

You could call it web2py3 with this logic
web2py was web for Python (at the time it was Python 2.x)
web2py3 will the web for Python 3.



FWIW, I second this.

黄祥

unread,
May 11, 2019, 9:55:34 PM5/11/19
to web2py-users
$ ./web3py-start applications/
Dashboard is at: http://127.0.0.1:8000/_dashboard

Traceback (most recent call last):

 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 560, in import_apps
   
module = importlib.machinery.SourceFileLoader(app_name, init).load_module()
 
File "<frozen importlib._bootstrap_external>", line 407, in _check_name_wrapper
 
File "<frozen importlib._bootstrap_external>", line 907, in load_module
 
File "<frozen importlib._bootstrap_external>", line 732, in load_module
 
File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
 
File "<frozen importlib._bootstrap>", line 696, in _load
 
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
 
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
 
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
 
File "/Users/sugizo/learn/python/web3py/applications/_dashboard/__init__.py", line 12, in <module>
    T
= Translator(T_FOLDER)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pluralize/__init__.py", line 60, in __init__
   
self.load(folder)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pluralize/__init__.py", line 65, in load
   
for filename in os.listdir(folder):
FileNotFoundError: [Errno 2] No such file or directory: '/Users/sugizo/learn/python/web3py/applications/_dashboard/translations'


Traceback (most recent call last):

 
File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 560, in import_apps
   
module = importlib.machinery.SourceFileLoader(app_name, init).load_module()
 
File "<frozen importlib._bootstrap_external>", line 407, in _check_name_wrapper
 
File "<frozen importlib._bootstrap_external>", line 907, in load_module
 
File "<frozen importlib._bootstrap_external>", line 732, in load_module
 
File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
 
File "<frozen importlib._bootstrap>", line 696, in _load
 
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
 
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
 
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
 
File "/Users/sugizo/learn/python/web3py/applications/toys/__init__.py", line 5, in <module>
    db
= DAL('sqlite://storage.db', folder=os.path.join(os.path.dirname(__file__), 'databases'))
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/base.py", line 171, in __call__
    obj
= super(MetaDAL, cls).__call__(*args, **kwargs)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/base.py", line 477, in __init__
   
"Failure to connect, tried %d times:\n%s" % (attempts, tb)
RuntimeError: Failure to connect, tried 5 times:

Traceback (most recent call last):

 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/base.py", line 457, in __init__
   
self._adapter = adapter(**kwargs)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/__init__.py", line 39, in __call__
    obj
= super(AdapterMeta, cls).__call__(*args, **kwargs)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/base.py", line 369, in __init__
   
super(SQLAdapter, self).__init__(*args, **kwargs)
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/base.py", line 53, in __init__
   
self.reconnect()
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/connection.py", line 154, in reconnect
   
self.connection = self.connector()
 
File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/pydal/adapters/sqlite.py", line 42, in connector
   
return self.driver.Connection(self.dbpath, **self.driver_args)
sqlite3
.OperationalError: unable to open database file

127.0.0.1 - - [12/May/2019 08:44:49] "GET /_dashboard HTTP/1.1" 404 459
127.0.0.1 - - [12/May/2019 08:46:38] "GET /_dashboard/index HTTP/1.1" 404 459

solutions:
mkdir applications/_dashboard/databases/
mkdir applications
/_dashboard/translations/

best regards,
stifan

Scott Hunter

unread,
May 12, 2019, 8:17:40 PM5/12/19
to web2py-users
Note: if the folder, translations, that is being complained about is added, the app still can't be reached, but there is no longer an exception reported: just the 404 page.

- Scott
127.0.0.1 - - [12/May/2019 08:44<span styl
It is loading more messages.
0 new messages