Re: [web2py] Re: RESTful service with access control

2019-05-13 Thread Val K
One yet important moment:
Do you set the view for your api?
I mean, that book example will not work without response.view='generic.json' if 
request is not local.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/4918e9e8-7690-4905-87ae-3a1b4cf00442%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web3py

2019-05-13 Thread Massimo Di Pierro
Added tornado to requirements. My bad

On Monday, 13 May 2019 20:03:35 UTC-7, 黄祥 wrote:
>
> yes, you are right, my bad
> echo tornado >> requirements.txt
> or
> pip3 install tornado
> required to make web3py started
>
> while for directories creation is needed to get access to the webapp
> mkdir applications/_dashboard/translations
> mkdir applications/_scaffold/databases
> mkdir applications/toys/databases
>
> best regards,
> stifan
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0d12a089-ded5-415d-8d7f-19d9beed0f8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] block entire app

2019-05-13 Thread lucas
hey one and all,

where, in what model or controller, is the best place to place a few lines 
of code that captures every controller/function call in the entire app and 
returns a single page with a line of text and link to shuttle the viewers 
to another website.  and what would be those few lines of code also. 
 basically, how to gracefully shutdown an entire app?

thank you in advance, lucas

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/41a8b725-77fc-45bf-8d91-356745b1e41e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web3py

2019-05-13 Thread 黄祥
yes, you are right, my bad
echo tornado >> requirements.txt
or
pip3 install tornado
required to make web3py started

while for directories creation is needed to get access to the webapp
mkdir applications/_dashboard/translations
mkdir applications/_scaffold/databases
mkdir applications/toys/databases

best regards,
stifan

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6c6312d7-24ca-41bf-8923-e51e63fed551%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: RESTful service with access control

2019-05-13 Thread Jim Steil
Val

I just created a test app based on the code in the book and all is working
as it should.  Must be something else in my other app that is causing the
trouble.

I'll check it out later.  Also looking into JWT...

On Mon, May 13, 2019 at 8:38 PM Jim Steil  wrote:

> Val
>
> Thanks so much for the references.  However, I'm really a bit lost.
>
> Using login_bare()??  Where does that come in to play?  And then a custom
> decorator?
>
> Am I doing something wrong that is preventing the sample in the book from
> working?  Not sure why mine is just redirecting.
>
> Any samples would really be appreciated.
>
> -Jim
>
>
> On Mon, May 13, 2019 at 1:34 PM Val K  wrote:
>
>> There is also
>> https://github.com/web2py/web2py/blob/master/gluon/authapi.py
>>
>> --
>> 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/7DfbZY6xRWU/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> web2py+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/913ce0a6-a2fa-4529-b934-dc2e3de1d1c0%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAERBpoADHF9XWjbLnHQMW%2Bd41G0vMrzCPmrPZP6%2BO_ecz3p%2B9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Password File

2019-05-13 Thread Suhas Jadhav
Hi Gurus,
In my web2py application, i am connecting to two different databases.
Currently, I am saving username and password in the code.
I want to use a password file or some other mean. Can you please help.

-- 
Thanks,
Suhas

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAM9jc1B6LSyDViqxfnwpS6VZYSB%2Bi4SrovmfKAR5%3DqghnZ8pKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: RESTful service with access control

2019-05-13 Thread Jim Steil
Val

Thanks so much for the references.  However, I'm really a bit lost.

Using login_bare()??  Where does that come in to play?  And then a custom
decorator?

Am I doing something wrong that is preventing the sample in the book from
working?  Not sure why mine is just redirecting.

Any samples would really be appreciated.

-Jim


On Mon, May 13, 2019 at 1:34 PM Val K  wrote:

> There is also
> https://github.com/web2py/web2py/blob/master/gluon/authapi.py
>
> --
> 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/7DfbZY6xRWU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/913ce0a6-a2fa-4529-b934-dc2e3de1d1c0%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAERBpoCOWf0t%2BP_fh18DnzoSrPisci6ifPr_tp69NLND3iJOXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web3py

2019-05-13 Thread Massimo Di Pierro
It is _dashboard not dashboard

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/83e744a7-bd64-43ec-af11-5a91894b0405%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: setting up pscycopg2

2019-05-13 Thread Dave S


On Monday, May 13, 2019 at 2:31:33 PM UTC-7, Dave S wrote:
>
> When I check Last week I ended up making the move to Postgres on the 
> busier of my production servers, and the changeover appears to be 
> successful (imported existing data via CSV).  I was interested to see that 
> the import preserved some gaps in the id field, and that Postgres was 
> filling some of those gaps and holding off on using id's above the imported 
> max(id).  But I'm also getting errors about 'ERROR 23505, duplicate key 
> value value viotlates unique contraint "updreq_y_pkey".  Key(id)=(23681) 
> already exists.'
>
> Looking at this made me realize I was running pg8000 (still supplied in 
> contrib in 2.15.4), and I wanted to switch to pscyopg2.  So I tried 
> pip install psycopg2
>
> and that was progressing fine until it got to copying the built module 
> into /usr/lib64/python2.7/dist-packages/psycogpg2 -- permission denied (not 
> too surprising).  So I tired the obvious:
> sudo pip install psycopg2
> Which ends abruptly with 
> [traceback excerpt]
> The 'pip==9.0.3' distribution was not found and required by the 
> application
> [...]
>
 

> What can I do now?
> (AWS Linux, up to date, OS_VERSION says "2018.03")
>
>  
>
 
Okay, I found the -t option, and from the web2py directory specified 
site-packages
Now, how do I get web2py.py to find the driver?

/dps

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a63511e9-bfbe-43f9-b497-a5f2e67f9c0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web3py

2019-05-13 Thread 黄祥
*in latest commits (100) steps will reproduce an error that make web3py 
won't start (error traceback reported on previous message)*
git clone https://github.com/web2py/web3py
cd web3py
pip3 install -r requirements.txt
./web3py-start applications/

*so need an extra steps to make web3py start in latest commit (100)*
git clone https://github.com/web2py/web3py
cd web3py
echo tornado >> requirements.txt
pip3 install -r requirements.txt
mkdir applications/_dashboard/translations
mkdir applications/_scaffold/databases
mkdir applications/toys/databases
./web3py-start applications/

*after running with extra steps what is appears in console is*
WARNING:tornado.access:404 GET /dashboard (127.0.0.1) 6.48ms
WARNING:tornado.access:404 GET /favicon.ico (127.0.0.1) 2.52ms
WARNING:tornado.access:404 GET /_scaffold/static/favicon.ico (127.0.0.1) 
2.60ms
WARNING:tornado.access:404 GET /examples/static/favicon.ico (127.0.0.1) 
16.25ms
WARNING:tornado.access:404 GET /myapp/static/favicon.ico (127.0.0.1) 1.85ms
WARNING:tornado.access:404 GET /todo/static/favicon.ico (127.0.0.1) 2.41ms
WARNING:tornado.access:404 GET /toys/static/favicon.ico (127.0.0.1) 2.31ms
ERROR:root:Traceback (most recent call last):
  File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 383, in 
wrapper
ret = func(*func_args, **func_kwargs)
  File "/Users/sugizo/learn/python/web3py/applications/examples/__init__.py"
, line 15, in oops
1/0
ZeroDivisionError: division by zero

id= 1
WARNING:tornado.access:404 GET /_scaffold/static/js/auth_test.js (127.0.0.1) 
3.63ms

if plan to use tornado as web server, should gunicorn is needed in 
requirements.txt ?

best regards,
stifan

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/05654d9e-0df1-42ea-8de9-449952834132%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] setting up pscycopg2

2019-05-13 Thread Dave S
When I check Last week I ended up making the move to Postgres on the busier 
of my production servers, and the changeover appears to be successful 
(imported existing data via CSV).  I was interested to see that the import 
preserved some gaps in the id field, and that Postgres was filling some of 
those gaps and holding off on using id's above the imported max(id).  But 
I'm also getting errors about 'ERROR 23505, duplicate key value value 
viotlates unique contraint "updreq_y_pkey".  Key(id)=(23681) already 
exists.'

Looking at this made me realize I was running pg8000 (still supplied in 
contrib in 2.15.4), and I wanted to switch to pscyopg2.  So I tried 
pip install psycopg2

and that was progressing fine until it got to copying the built module into 
/usr/lib64/python2.7/dist-packages/psycogpg2 -- permission denied (not too 
surprising).  So I tired the obvious:
sudo pip install psycopg2
Which ends abruptly with 
[traceback excerpt]
The 'pip==9.0.3' distribution was not found and required by the application

When I check pip's version
pip --version
gives
pip 18.0 for  /usr/.../pip (python2.7)


and 
sudo pip --version
gives the 9.0.3 not found message.

What can I do now?
(AWS Linux, up to date, OS_VERSION says "2018.03")

/dps




-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a2d7f346-a200-4095-ab67-bac2b1700319%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: authapi.py

2019-05-13 Thread Val K


https://github.com/web2py/web2py/blob/4a90c82ee4271b2a17c187d41138a03249c14350/gluon/tools.py#L1002




https://github.com/robertop23/web2py_vuejs_vuetify/blob/master/controllers/api.py

On Monday, May 13, 2019 at 10:11:31 PM UTC+3, Tito Garrido wrote:
>
> Hi Guys!
>
> Is there any example using authapi + jwt in any documentation?
>
> Thank you!
>
> Tito
>
> -- 
>
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/97e19835-dce8-499d-aa2b-140641f862fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] authapi.py

2019-05-13 Thread Tito Garrido
Hi Guys!

Is there any example using authapi + jwt in any documentation?

Thank you!

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAL67CHHbgH6Y9z-3SyYm-7SSorJtagX7rpW2QAdRz2y7GhZZtw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: RESTful service with access control

2019-05-13 Thread Val K
There is also https://github.com/web2py/web2py/blob/master/gluon/authapi.py

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/913ce0a6-a2fa-4529-b934-dc2e3de1d1c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: RESTful service with access control

2019-05-13 Thread Val K
For services I use auth.login_bare(u,p) and handmade decorator based on 
auth.is_logged_in() - don't forget about parens! 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/cb4a21da-ec1e-4b6d-a2dd-7b942ce7be46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web3py

2019-05-13 Thread En Ware
./web3py-start applications/

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

Dashboard is at: http://127.0.0.1:8000/_dashboard
Traceback (most recent call last):
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/web3py/web3py/core.py", 
line 570, in import_apps
module = importlib.machinery.SourceFileLoader(app_name, 
init).load_module()
  File "", line 399, in 
_check_name_wrapper
  File "", line 823, in load_module
  File "", line 682, in load_module
  File "", line 265, in _load_module_shim
  File "", line 684, in _load
  File "", line 665, in _load_unlocked
  File "", line 678, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/web3py/applications/toys/__init__.py",
 
line 5, in 
db = DAL('sqlite://storage.db', 
folder=os.path.join(os.path.dirname(__file__), 'databases'))
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/lib/python3.6/site-packages/pydal/base.py",
 
line 171, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/lib/python3.6/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/aaronm/.pyenv/versions/3.6.4/envs/web3py/lib/python3.6/site-packages/pydal/base.py",
 
line 457, in __init__
self._adapter = adapter(**kwargs)
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/lib/python3.6/site-packages/pydal/adapters/__init__.py",
 
line 39, in __call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/lib/python3.6/site-packages/pydal/adapters/base.py",
 
line 369, in __init__
super(SQLAdapter, self).__init__(*args, **kwargs)
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/lib/python3.6/site-packages/pydal/adapters/base.py",
 
line 53, in __init__
self.reconnect()
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/lib/python3.6/site-packages/pydal/connection.py",
 
line 154, in reconnect
self.connection = self.connector()
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/lib/python3.6/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


Traceback (most recent call last):
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/web3py/web3py/core.py", 
line 570, in import_apps
module = importlib.machinery.SourceFileLoader(app_name, 
init).load_module()
  File "", line 399, in 
_check_name_wrapper
  File "", line 823, in load_module
  File "", line 682, in load_module
  File "", line 265, in _load_module_shim
  File "", line 684, in _load
  File "", line 665, in _load_unlocked
  File "", line 678, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/web3py/applications/_dashboard/__init__.py",
 
line 12, in 
T = Translator(T_FOLDER)
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/lib/python3.6/site-packages/pluralize/__init__.py",
 
line 60, in __init__
self.load(folder)
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/lib/python3.6/site-packages/pluralize/__init__.py",
 
line 65, in load
for filename in os.listdir(folder):
FileNotFoundError: [Errno 2] No such file or directory: 
'/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/web3py/applications/_dashboard/translations'

Traceback (most recent call last):
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/web3py/web3py/core.py", 
line 570, in import_apps
module = importlib.machinery.SourceFileLoader(app_name, 
init).load_module()
  File "", line 399, in 
_check_name_wrapper
  File "", line 823, in load_module
  File "", line 682, in load_module
  File "", line 265, in _load_module_shim
  File "", line 684, in _load
  File "", line 665, in _load_unlocked
  File "", line 678, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/web3py/applications/_scaffold/__init__.py",
 
line 1, in 
from . import controllers
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/lib/python3.6/site-packages/reloader.py",
 
line 158, in _import
base = _baseimport(name, globals, locals, fromlist, level)
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/web3py/applications/_scaffold/controllers.py",
 
line 2, in 
from .common import db, session, T, cache, auth
  File 
"/Users/aaronm/.pyenv/versions/3.6.4/envs/web3py/lib/python3.6/site-packages/reloader.py",
 
line 158, in _import

[web2py] Re: Web3py

2019-05-13 Thread En Ware
It did until I install tornado , but still can't access the dashboard or 
any of the apps. 

 I am going to do a new git clone and try again. 

On Monday, May 13, 2019 at 12:29:29 PM UTC-5, Massimo Di Pierro wrote:
>
> That error in the console is intentional. It is an example of what happens 
> when there is a bug in app code. It should not prevent web3py from running. 
> Or does it?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/cd37c2bf-920f-4803-95bc-b037dc106a9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: RESTful service with access control

2019-05-13 Thread Jim S
Shoot, looks like my initial testing wasn't even working.  I was just 
checking the status code which was returning 200, but didn't realize it was 
redirecting me to the login page.  Any way i can stop that?

-Jim

On Monday, May 13, 2019 at 11:51:27 AM UTC-5, Val K wrote:
>
> As far as I understand, basic means passing login and password in the 
> headers and it doesn't matter if username or email is used as login, no?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/358b5bc3-1749-4ea2-8015-d40c78a7b844%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web3py

2019-05-13 Thread Massimo Di Pierro
That error in the console is intentional. It is an example of what happens when 
there is a bug in app code. It should not prevent web3py from running. Or does 
it?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2e1b8baa-d46a-4f8d-adbe-56fb57361f86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web3py

2019-05-13 Thread En Ware
I also have the same errors , I installed tornado also 

On Monday, May 13, 2019 at 3:05:05 AM UTC-5, 黄祥 wrote:
>
> forgot to include the logs after get the web3py started (taken from 
> terminal)
> WARNING:tornado.access:404 GET /dashboard (127.0.0.1) 6.48ms
> WARNING:tornado.access:404 GET /favicon.ico (127.0.0.1) 2.52ms
> WARNING:tornado.access:404 GET /_scaffold/static/favicon.ico (127.0.0.1) 
> 2.60ms
> WARNING:tornado.access:404 GET /examples/static/favicon.ico (127.0.0.1) 
> 16.25ms
> WARNING:tornado.access:404 GET /myapp/static/favicon.ico (127.0.0.1) 
> 1.85ms
> WARNING:tornado.access:404 GET /todo/static/favicon.ico (127.0.0.1) 2.41ms
> WARNING:tornado.access:404 GET /toys/static/favicon.ico (127.0.0.1) 2.31ms
> ERROR:root:Traceback (most recent call last):
>   File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 383, in 
> wrapper
> ret = func(*func_args, **func_kwargs)
>   File 
> "/Users/sugizo/learn/python/web3py/applications/examples/__init__.py", 
> line 15, in oops
> 1/0
> ZeroDivisionError: division by zero
>
> id= 1
> WARNING:tornado.access:404 GET /_scaffold/static/js/auth_test.js (127.0.
> 0.1) 3.63ms
>
> best regards,
> stifan
>
> On Monday, May 13, 2019 at 2:53:35 PM UTC+7, 黄祥 wrote:
>>
>> *last commit need extra step on terminal*
>> echo tornado >> requirements.txt
>> mkdir applications/_dashboard/translations
>> mkdir applications/_scaffold/databases
>> mkdir applications/toys/databases
>>
>> *error traceback*
>> $ ./web3py-start applications/
>> Traceback (most recent call last):
>>   File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 570, in 
>> import_apps
>> module = importlib.machinery.SourceFileLoader(app_name, init).
>> load_module()
>>   File "", line 407, in 
>> _check_name_wrapper
>>   File "", line 907, in load_module
>>   File "", line 732, in load_module
>>   File "", line 265, in _load_module_shim
>>   File "", line 696, in _load
>>   File "", line 677, in _load_unlocked
>>   File "", line 728, in exec_module
>>   File "", line 219, in 
>> _call_with_frames_removed
>>   File 
>> "/Users/sugizo/learn/python/web3py/applications/_dashboard/__init__.py", 
>> line 12, in 
>> 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 570, in 
>> import_apps
>> module = importlib.machinery.SourceFileLoader(app_name, init).
>> load_module()
>>   File "", line 407, in 
>> _check_name_wrapper
>>   File "", line 907, in load_module
>>   File "", line 732, in load_module
>>   File "", line 265, in _load_module_shim
>>   File "", line 696, in _load
>>   File "", line 677, in _load_unlocked
>>   File "", line 728, in exec_module
>>   File "", line 219, in 
>> _call_with_frames_removed
>>   File 
>> "/Users/sugizo/learn/python/web3py/applications/_scaffold/__init__.py", 
>> line 1, in 
>> 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 2, in 
>> from .common import db, session, T, cache, auth
>>   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/common.py", 
>> line 8, in 
>> from .models import db
>>   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 5, in 
>> db = DAL(settings.DB_URI, folder=settings.DB_FOLDER, 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 
>> 

[web2py] RESTful service with access control

2019-05-13 Thread Val K
As far as I understand, basic means passing login and password in the headers 
and it doesn't matter if username or email is used as login, no?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a5747442-2967-4971-8d08-62aeab388a9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Could this problem in production be related to web2py?

2019-05-13 Thread Lisandro
After doing a lot of reading about uWSGI, I've discovered that "uWSGI cores 
are not CPU cores" (this was confirmed by unbit developers 
, the ones 
that wrote and mantain uWSGI). This makes me think that the issue I'm 
experiencing is due to a misconfiguration of uWSGI. But as I'm a developer 
and not a sysadmin, it's being hard for me to figure out exactly what uWSGI 
options should I tweak. 

I know this is out of the scope of this group, but I'll post my uWSGI app 
configuration anyway, in case someone still wants to help:

[uwsgi]
pythonpath = /var/www/medios/
mount = /=wsgihandler:application
master = true
workers = 40
cpu-affinity = 3
lazy-apps = true
harakiri = 60
reload-mercy = 8
max-requests = 4000
no-orphans = true
vacuum = true
buffer-size = 32768
disable-logging = true
ignore-sigpipe = true
ignore-write-errors = true
listen = 65535
disable-write-exception = true


Just to remember, this is running on a machine with 16 CPUs.
Maybe I should *enable-threads*, set *processes* options and maybe tweak 
*cpu-affinity. *
My application uses Redis for caching, so I think I can enable threads 
safely. 
What do you think?


El jueves, 9 de mayo de 2019, 21:10:57 (UTC-3), Lisandro escribió:
>
> I've checked my app's code once again and I can confirm that it doesn't 
> create threads. It only uses subprocess.cal() within functions that are 
> called in the scheduler environment, I understand that's the proper way to 
> do it because those calls don't run in uwsgi environment.
>
> In the other hand, I can't disable the master process, I use "lazy-apps" 
> and "touch-chain-reload" options of uwsgi in order to achieve graceful 
> reloading, because acordingly to the documentation about graceful 
> reloading 
> 
> :
> *"All of the described techniques assume a modern (>= 1.4) uWSGI release 
> with the master process enabled."*
>
> Graceful reloading allows me to update my app's code and reload uwsgi 
> workers smoothly, without downtime or errors. What can I do if I can't 
> disable master process?
>
> You mentioned the original problem seems to be a locking problem due to 
> threads. If my app doesn't open threads, where else could be the cause of 
> the issue? 
>
> The weirdest thing for me is that the timeouts are always on core 0. I 
> mean, uwsgi runs between 30 and 45 workers over 16 cores, isn't too much of 
> a coincidence that requests that hang correspond to a few workers always 
> assigned on core 0?
>
>
> El jueves, 9 de mayo de 2019, 17:10:19 (UTC-3), Leonel Câmara escribió:
>>
>> Yes I meant stuff exactly like that.
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b7bf5665-4a2e-4ebd-a147-9f82d2318820%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] RESTful service with access control

2019-05-13 Thread Jim S
Hi

I'm setting up a REST service that requires authentication.  I'm following 
the example here:

http://web2py.com/books/default/chapter/29/10/services#Access-Control

Here is the example with basic login:

auth.settings.allow_basic_login = True

@auth.requires_login()
@request.restful()
def api(): 
def GET(s):
return 'access granted, you said %s' % s 
return locals()

However, I'd like to use email authentication instead of basic_login.  

When I remove the first line, and pass proper email address and password, I 
get a 403 return code.

Anyone had success with a RESTful service using email authentication?

-Jim

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/8a2ef851-6957-42ba-ac0b-af718e57ef75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Python version in web2py console says 3.7 but 2.7 in the web console settings

2019-05-13 Thread Robert Rice
I am testing OpenCV and need version 2.7 and that is what the site version 
says (2.7.12).
I updated the default.py for this new website and it failed due to the use 
of python v 2.7 classes.
Whats up?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/ebc364db-281a-4859-be58-6c61f41d6fae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Future of web2py

2019-05-13 Thread Massimo Di Pierro
I agree. About "tools that deliver apps to the client". I once experimented 
with this https://github.com/mdipierro/regift It is a cordova app that can 
be updated from the server without reinstallation. The app keeps the state 
and talks to server only if available. There is a lot that can be done in 
this direction.

On Monday, 13 May 2019 01:53:00 UTC-7, mweissen wrote:
>
> A few thoughts about PWA:
>
> First: Web2py is great. But maybe the discussion should go deeper: how 
> will the internet be used now and in the future? It will probably be used 
> mainly by the mobile devices. With all the problems that arise from the 
> fact that the Internet is not available everywhere and constantly. And what 
> do mobile devices need? An exclusively server-side organized service can 
> not do that. We need clients to eliminate these bottlenecks - among other 
> things, this is the job of a PWA.
>
> Web2py or Web3py could take over the management of the data. So, above 
> all, Web2py / Web3py could support the administration of the data and 
> provide tools that deliver apps to the client.
>
> PWA clients include a lot of Javascript programs. In this model, Web2py / 
> Web3py should support the writing of Javascript modules.
>
> The client also needs access to the data in the event of a lack of 
> Internet connection. Therefore, a local database must exist. PouchDB and 
> CouchPB are ideally suited to synchronize the local database at the client 
> and the central database at the server. Access to CouchDB / PouchDB could 
> be supported by Web2py. CouchDB and PouchDB work very efficiently with 
> predefined queries. This would require an extension of the DAL or a 
> separate library for CouchDB.
>
> Regards, Martin
>
>
> Am Mo., 13. Mai 2019 um 10:10 Uhr schrieb Val K :
>
>> You are right, this is 100% client side technology. I think we can 
>> provide a simple universal script that will show some configurable static 
>> page when offline
>>
>> -- 
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/bf317c34-fc35-43d0-942a-374a9a56aeb3%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6212804a-9052-4fb1-ad57-2cd8253573cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] gluon.contrib.pymysql.err.Error AssertionError('Protocol error, expecting EOF',)

2019-05-13 Thread Gilad Hoshmand
Hi all,

I built a join query which breaks up a field that has '|' char as separator 
of values to multiple rows with single values (ie. field value = '1|2|3' , 
rows will be multiplied with single_value_field = 1 , single_value_field = 
2 etc..)
Filters some rows ('Having ... ' )
Then join with a table that I need to get values from.

I tested it on mysql 5.7 and it works fine.

I'm using db.executesql(...) to execute the query because I find it hard to 
make with the DAL but I'm getting an error.
The query is:

SELECT 
 *
FROM
(SELECT * , SUBSTRING_INDEX(SUBSTRING_INDEX(field1, '|', numbers.n), 
'|', - 1) AS single_value_field
FROM
(SELECT 1 n UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 
4 UNION ALL SELECT 5) numbers
INNER JOIN table1 ON CHAR_LENGTH(field1) - CHAR_LENGTH(REPLACE(field1, 
'|', '')) >= numbers.n - 1
HAVING (field1 IS NOT NULL
AND field1 != '||'
AND single_value_field IS NOT NULL
AND single_value_field != '')) new_table_alias
JOIN
table2 ON (table2.id = single_value_field)
WHERE (table2.field2 = '' OR table2.field2 is null)


My Error arises on db.executesql(...)  only when I include the last Join 
clause: 
JOIN
table2 ON (table2.id = single_value_field)

If it is omitted - no problems.

Full error(private bits renamed as in query):

 (, AssertionError('Protocol error, expecting 
EOF',))Version
web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.

Traceback (most recent call last):
  File "/path/gluon/restricted.py", line 227, in restricted
exec ccode in environment
  File " 
/path/controllers/myController.py"
 
,
 line 93, in 
  File "/path/gluon/globals.py", line 417, in 
self._caller = lambda f: f()
  File "/path/controllers/myController.py" 
,
 line 15, in index
rows = db.executesql(query);
  File "/path/gluon/packages/dal/pydal/base.py", line 1019, in executesql
adapter.execute(query)
  File "/path/gluon/packages/dal/pydal/adapters/base.py", line 1388, in execute
return self.log_execute(*a, **b)
  File "/path/gluon/packages/dal/pydal/adapters/base.py", line 1382, in 
log_execute
ret = self.get_cursor().execute(command, *a[1:], **b)
  File "/path/gluon/contrib/pymysql/cursors.py", line 117, in execute
self.errorhandler(self, exc, value)
  File "/path/gluon/contrib/pymysql/connections.py", line 200, in 
defaulterrorhandler
raise Error(errorclass, errorvalue)
Error: (, AssertionError('Protocol error, 
expecting EOF',))


Thank you all!

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0e82148c-2e3c-4371-86c4-8a8ada59425a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: gmail unable to send email

2019-05-13 Thread mostwanted
hahahah* 'being marked as "EVIL"'*I really like your solution, i will 
give it a try as well.

Mostwanted

On Sunday, May 12, 2019 at 11:11:10 AM UTC+2, Dave S wrote:
>
>
>
> On Monday, May 6, 2019 at 6:49:33 AM UTC-7, Leonel Câmara wrote:
>>
>> If you don't send too many emails I recommend using sparkpost as they 
>> have a free tier and I made a plugin that makes it really easy to use with 
>> web2py
>>
>> https://github.com/leonelcamara/web2py_sparkpost
>>
>
> For what its worth, I have been using the local mailserver on the AWS 
> Linux running my production code, and that works very well, although so far 
> it's only had to send to a handful of addresses.  Those addresses are 
> served by gmail, though, and we did have to set up the additional DNS 
> records to keep the messages from being marked as "EVIL".l  We had someone 
> in the office who had done that once before, so it wasn't a terrible pain, 
> but obviously SparkPost is going to handle that for you.
>
> /dps
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/332b5e09-032e-40c3-a886-7cf040cedc0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Future of web2py

2019-05-13 Thread Carlos Costa
I don't think all PWA cases must work 100% offline.
For 100% offline apps you just need a server to "install" your app, and so
web2py would be handy, but no more after install in client.
This is not case we should aim as web2py as focused on database driven apps.

Sync database may be desirable in some cases but no viable in many cases.
For most cases you want to cache a bit of data, like user data for example.
Think of a ordering or data collecting app, you may want to cache
items/products and also the order and sync it later.
For me this would be awesome but a little complicated.

My opinion is that for now if scaffold helped you to be eligible for A2HS
feature and cache static assets in client, it would be very helpful.

Em seg, 13 de mai de 2019 às 07:46, Val K  escreveu:

> my example is not fully featured PWA, but it works offline and as I
> mentioned above it is possible to make that web23py application will show
> something better than nothing when offline
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/fd6ea76b-7d3b-4704-886b-a2e6bc4d6e47%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
At.

Carlos J. Costa
--
Cientista da Computação - Esp. Gestão em Telecom

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAGsD4NxhgGCB%3D9VndXzS4-ZsKMOtgQnbG0BJzLJbnFo29xQeDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Future of web2py

2019-05-13 Thread Val K
my example is not fully featured PWA, but it works offline and as I mentioned 
above it is possible to make that web23py application will show something 
better than nothing when offline

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/fd6ea76b-7d3b-4704-886b-a2e6bc4d6e47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Future of web2py

2019-05-13 Thread João Matos
You are correct. I though you meant keeping the app open and trying to use 
the database or loading another page.
In the case you close the app then you would need some kind of embedded 
server (as I already mentioned) or serviceWorker (which I think is 
something lighter but similar).

For the case where you don't close the app and only lose Internet 
connection and/or db connection you can check using JS. It was in this 
scenario that I meant any web app could do that.

segunda-feira, 13 de Maio de 2019 às 11:19:36 UTC+1, Val K escreveu:
>
> 'That could be done by every web app (web2py or otherwise).'
>
> it is not quite so,  if you close regular web  page  (without embedded 
> serviceWorker) and  try to open it again when offline you will get nothing, 
> I suppose.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/3b0361d2-bf53-4904-b8c7-f38ddab57a6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Future of web2py

2019-05-13 Thread Val K
'That could be done by every web app (web2py or otherwise).'

it is not quite so,  if you close regular web  page  (without embedded 
serviceWorker) and  try to open it again when offline you will get nothing, I 
suppose.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/026abacb-e8a4-427b-8663-85d7584307e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py - didn't disconect from postgreSQL auth database (TIME_WAIT)

2019-05-13 Thread Krzysztof Jeleń


>
>> I'm using web2py (Version 2.14.6-stable+timestamp.2016.05.09.19.18.48). 
>>
>
> How long have you been using this version?  What OS and what front end and 
> what version of Python?
>

3 years currently, python version is 2.7.5, Centos 7.5.1804, kernel 3.10.0

>  
>
>> Last week I've start getting strange errors on client side 
>>
>
> What changed on your server?
>

I've increase number of applications connected to this service and then 
Chrome (user page) start showing "waiting for available socket..." (and 
page is not loaded). Applications use mostly wget and some of them 
QNetworkAccessManager (C++ Qt component for requests handling).
 

>  
>
>> ("waiting for available socket") - I'm using Chrome. After investigation 
>> I found that DAL (PostgreSQL) object didn't close connection to database 
>> after finishing request: 
>>
>  

> I've seen issues with Chrome talking to a local instance of web2py (on 
>> W10)  using Rocket, and Chrome seems to get into a state where something 
>> cache-related is driving a lot of requests into Rocket; Usually closing 
>> Chrome clears things up (actually, closing one window of Chrome is enough, 
>> and sometimes it seems to work to close just one tab -- if I get the right 
>> one; Chrome uses multiple processes, so windows are independent, and tabs 
>> may be also).  In this environment, I'm also using 2.14.6, though I've been 
>> trialing newer versions.
>>
>
Current;y I'm not sure is this only Chrome issue, the problem is that using 
DAL withput calling explicity DAL close method leave a lot of sockets in 
wating state on server side. I was able to reduce its number to 30 (from 
~300) adding excplicity call to close method and removing DAL connection 
for some requests which didn't need database (or I use my own db 
abstraction layer with close mthod called explicity on postgreSQL 
connection). From that point of view I'm pretty user that this issue is 
kind of DAL error.
 

>
>
>> netstat -p -n -o | grep "" 
>>
>> return a lot of entries like (~300):
>>
>> tcp0  0 127.0.0.1:36062 127.0.0.1:5434  
>> TIME_WAIT   -timewait (24.30/0/0)
>>
>> DAL object is created in models/db.py and then it is passed to Auth 
>> constructor. When there is no incoming requests to application after some 
>> time (60s) every TIME_WAIT socket is closed and everything looks fine, When 
>> requests start comming then number of TIME_WAIT sockets start growing and 
>> stay about 300.
>>
>> Is there a way to call close on underlaying postgresql connection layer?
>> Is there a way to invoke some code every time processing data is finished 
>> for each request (after server proces user quest and before start sending 
>> it to browser)?
>> or maybe that was fixed in latest version
>>
>> BR
>>   KJ
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/7b5fcba7-ea1f-4abe-bb5f-1242f5214557%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Future of web2py

2019-05-13 Thread João Matos

That is only checking if the Internet connection/db connection exists.
That could be done by every web app (web2py or otherwise).
That is not the definition of a PWA.
>From wikipedia
"
Progressive web applications (PWAs) are web applications that load like regular 
web pages or websites but can offer the user functionality such as working 
offline, push notifications, and device hardware access traditionally available 
only to native applications. PWAs combine the flexibility of the web with the 
experience of a native application.
"

Showing an error message is not the same as working offline (which requires an 
embedded server as I mentioned in the previous message) and the same goes to 
the hardware access.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/9621e3be-02ef-43a4-8302-681ea50ce6e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Future of web2py

2019-05-13 Thread Martin Weissenboeck
A few thoughts about PWA:

First: Web2py is great. But maybe the discussion should go deeper: how will
the internet be used now and in the future? It will probably be used mainly
by the mobile devices. With all the problems that arise from the fact that
the Internet is not available everywhere and constantly. And what do mobile
devices need? An exclusively server-side organized service can not do that.
We need clients to eliminate these bottlenecks - among other things, this
is the job of a PWA.

Web2py or Web3py could take over the management of the data. So, above all,
Web2py / Web3py could support the administration of the data and provide
tools that deliver apps to the client.

PWA clients include a lot of Javascript programs. In this model, Web2py /
Web3py should support the writing of Javascript modules.

The client also needs access to the data in the event of a lack of Internet
connection. Therefore, a local database must exist. PouchDB and CouchPB are
ideally suited to synchronize the local database at the client and the
central database at the server. Access to CouchDB / PouchDB could be
supported by Web2py. CouchDB and PouchDB work very efficiently with
predefined queries. This would require an extension of the DAL or a
separate library for CouchDB.

Regards, Martin


Am Mo., 13. Mai 2019 um 10:10 Uhr schrieb Val K :

> You are right, this is 100% client side technology. I think we can provide
> a simple universal script that will show some configurable static page when
> offline
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/bf317c34-fc35-43d0-942a-374a9a56aeb3%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAMcwXCe9Ru_hcSgee9PDLDc%2BFMMTRcpQf4zKE8Sf7puiMkuXPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Future of web2py

2019-05-13 Thread Val K
You are right, this is 100% client side technology. I think we can provide a 
simple universal script that will show some configurable static page when 
offline

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/bf317c34-fc35-43d0-942a-374a9a56aeb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web3py

2019-05-13 Thread 黄祥
forgot to include the logs after get the web3py started (taken from 
terminal)
WARNING:tornado.access:404 GET /dashboard (127.0.0.1) 6.48ms
WARNING:tornado.access:404 GET /favicon.ico (127.0.0.1) 2.52ms
WARNING:tornado.access:404 GET /_scaffold/static/favicon.ico (127.0.0.1) 
2.60ms
WARNING:tornado.access:404 GET /examples/static/favicon.ico (127.0.0.1) 
16.25ms
WARNING:tornado.access:404 GET /myapp/static/favicon.ico (127.0.0.1) 1.85ms
WARNING:tornado.access:404 GET /todo/static/favicon.ico (127.0.0.1) 2.41ms
WARNING:tornado.access:404 GET /toys/static/favicon.ico (127.0.0.1) 2.31ms
ERROR:root:Traceback (most recent call last):
  File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 383, in 
wrapper
ret = func(*func_args, **func_kwargs)
  File "/Users/sugizo/learn/python/web3py/applications/examples/__init__.py"
, line 15, in oops
1/0
ZeroDivisionError: division by zero

id= 1
WARNING:tornado.access:404 GET /_scaffold/static/js/auth_test.js (127.0.0.1) 
3.63ms

best regards,
stifan

On Monday, May 13, 2019 at 2:53:35 PM UTC+7, 黄祥 wrote:
>
> *last commit need extra step on terminal*
> echo tornado >> requirements.txt
> mkdir applications/_dashboard/translations
> mkdir applications/_scaffold/databases
> mkdir applications/toys/databases
>
> *error traceback*
> $ ./web3py-start applications/
> Traceback (most recent call last):
>   File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 570, in 
> import_apps
> module = importlib.machinery.SourceFileLoader(app_name, init).
> load_module()
>   File "", line 407, in 
> _check_name_wrapper
>   File "", line 907, in load_module
>   File "", line 732, in load_module
>   File "", line 265, in _load_module_shim
>   File "", line 696, in _load
>   File "", line 677, in _load_unlocked
>   File "", line 728, in exec_module
>   File "", line 219, in 
> _call_with_frames_removed
>   File 
> "/Users/sugizo/learn/python/web3py/applications/_dashboard/__init__.py", 
> line 12, in 
> 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 570, in 
> import_apps
> module = importlib.machinery.SourceFileLoader(app_name, init).
> load_module()
>   File "", line 407, in 
> _check_name_wrapper
>   File "", line 907, in load_module
>   File "", line 732, in load_module
>   File "", line 265, in _load_module_shim
>   File "", line 696, in _load
>   File "", line 677, in _load_unlocked
>   File "", line 728, in exec_module
>   File "", line 219, in 
> _call_with_frames_removed
>   File 
> "/Users/sugizo/learn/python/web3py/applications/_scaffold/__init__.py", 
> line 1, in 
> 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 2, in 
> from .common import db, session, T, cache, auth
>   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/common.py", 
> line 8, in 
> from .models import db
>   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 5, in 
> db = DAL(settings.DB_URI, folder=settings.DB_FOLDER, 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, inhttp://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 

[web2py] Re: Web3py

2019-05-13 Thread 黄祥
*last commit need extra step on terminal*
echo tornado >> requirements.txt
mkdir applications/_dashboard/translations
mkdir applications/_scaffold/databases
mkdir applications/toys/databases

*error traceback*
$ ./web3py-start applications/
Traceback (most recent call last):
  File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 570, in 
import_apps
module = importlib.machinery.SourceFileLoader(app_name, init).
load_module()
  File "", line 407, in 
_check_name_wrapper
  File "", line 907, in load_module
  File "", line 732, in load_module
  File "", line 265, in _load_module_shim
  File "", line 696, in _load
  File "", line 677, in _load_unlocked
  File "", line 728, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File 
"/Users/sugizo/learn/python/web3py/applications/_dashboard/__init__.py", 
line 12, in 
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 570, in 
import_apps
module = importlib.machinery.SourceFileLoader(app_name, init).
load_module()
  File "", line 407, in 
_check_name_wrapper
  File "", line 907, in load_module
  File "", line 732, in load_module
  File "", line 265, in _load_module_shim
  File "", line 696, in _load
  File "", line 677, in _load_unlocked
  File "", line 728, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File 
"/Users/sugizo/learn/python/web3py/applications/_scaffold/__init__.py", 
line 1, in 
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 2, in 
from .common import db, session, T, cache, auth
  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/common.py", 
line 8, in 
from .models import db
  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 5, in 
db = DAL(settings.DB_URI, folder=settings.DB_FOLDER, 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

Traceback (most recent call last):
  File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 570, in 
import_apps
module = importlib.machinery.SourceFileLoader(app_name, init).
load_module()
  File "", line 407, in 
_check_name_wrapper
  File "", line 907, in load_module
  File "", line 732, in load_module
  File "", line 265, in _load_module_shim
  File "", line 696, in _load
  File "", line 677, in _load_unlocked
  File "", line 728, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  

Re: [web2py] Re: Future of web2py

2019-05-13 Thread Massimo Di Pierro
Nice. But would you agree with me that this is mostly a client side 
functionality? Web2py and web3py are mostly serverside frameworks.
What would you want to see in web3py that helps with PWA?

On Sunday, 12 May 2019 23:41:01 UTC-7, Val K wrote:
>
> I made one: 
> https://vuepydemo.pythonanywhere.com/todo_pwa/default/index.html
> Follow the link then close the page, disconnect from internet and open 
> again.  Try to add/remove a todo item - you will get the alert 'Network 
> problem'
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/5b8b6f2e-2339-492f-ac6f-9cf3f7ea35d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web3py

2019-05-13 Thread Massimo Di Pierro
Want to help:

1) need a version of this 
https://github.com/web2py/web3py/blob/master/applications/_scaffold/static/components/auth.html
 
with bootstrap style for forms
2) like for login and register, need similar methods for the other actions: 
https://github.com/web2py/web3py/blob/master/applications/_scaffold/static/components/auth.js
3) some of the backend logic is missing: 
https://github.com/web2py/web3py/blob/master/web3py/utils/auth.py#L40 (my 
next todo unless somebody beats me)


On Sunday, 12 May 2019 17:17:40 UTC-7, Scott Hunter wrote:
>
> 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
>
> On Saturday, May 11, 2019 at 9:55:34 PM UTC-4, 黄祥 wrote:
>>
>> $ ./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 "", line 407, in 
>> _check_name_wrapper
>>   File "", line 907, in load_module
>>   File "", line 732, in load_module
>>   File "", line 265, in _load_module_shim
>>   File "", line 696, in _load
>>   File "", line 677, in _load_unlocked
>>   File "", line 728, in exec_module
>>   File "", line 219, in 
>> _call_with_frames_removed
>>   File 
>> "/Users/sugizo/learn/python/web3py/applications/_dashboard/__init__.py", 
>> line 12, in 
>> 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 "", line 407, in 
>> _check_name_wrapper
>>   File "", line 907, in load_module
>>   File "", line 732, in load_module
>>   File "", line 265, in _load_module_shim
>>   File "", line 696, in _load
>>   File "", line 677, in _load_unlocked
>>   File "", line 728, in exec_module
>>   File "", line 219, in 
>> _call_with_frames_removed
>>   File "/Users/sugizo/learn/python/web3py/applications/toys/__init__.py", 
>> line 5, in 
>> 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>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

[web2py] Re: Web3py

2019-05-13 Thread Massimo Di Pierro
can you please try again with the latest version?

On Sunday, 12 May 2019 17:17:40 UTC-7, Scott Hunter wrote:
>
> 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
>
> On Saturday, May 11, 2019 at 9:55:34 PM UTC-4, 黄祥 wrote:
>>
>> $ ./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 "", line 407, in 
>> _check_name_wrapper
>>   File "", line 907, in load_module
>>   File "", line 732, in load_module
>>   File "", line 265, in _load_module_shim
>>   File "", line 696, in _load
>>   File "", line 677, in _load_unlocked
>>   File "", line 728, in exec_module
>>   File "", line 219, in 
>> _call_with_frames_removed
>>   File 
>> "/Users/sugizo/learn/python/web3py/applications/_dashboard/__init__.py", 
>> line 12, in 
>> 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 "", line 407, in 
>> _check_name_wrapper
>>   File "", line 907, in load_module
>>   File "", line 732, in load_module
>>   File "", line 265, in _load_module_shim
>>   File "", line 696, in _load
>>   File "", line 677, in _load_unlocked
>>   File "", line 728, in exec_module
>>   File "", line 219, in 
>> _call_with_frames_removed
>>   File "/Users/sugizo/learn/python/web3py/applications/toys/__init__.py", 
>> line 5, in 
>> 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>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/64e19afd-937a-4f51-a695-d7d6becdb73c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Future of web2py

2019-05-13 Thread Val K
I made one: https://vuepydemo.pythonanywhere.com/todo_pwa/default/index.html
Follow the link then close the page, disconnect from internet and open again.  
Try to add/remove a todo item - you will get the alert 'Network problem'

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/5704634c-f2e0-409f-8eac-9fb1ae30dcb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.