[web2py] Re: py4web and celery

2019-12-26 Thread JSalvat
May need to add  *celery  *to requirements  ?


-- 
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/e213ae10-0008-4f68-9c96-4e4ce00bf2bd%40googlegroups.com.


[web2py] Re: py4web and celery

2019-12-26 Thread JSalvat
Massimo, now getting other errors:

Is still experimental...


Choose a one-time dashboard password:
Storing the hashed password in file "password.txt"
Dashboard is at: http://127.0.0.1:8000/_dashboard
[ ] loading examples ...
 [A[X] loaded examples
[ ] loading sample ...
 [A[X] loaded sample
[ ] loading todo ...
 [A[X] loaded todo
[ ] loading _dashboard ...
 [A[FAILED] loading _dashboard
Traceback (most recent call last):
  File "C:\wwwroot\py4web\py4web\core.py", line 825, in import_app
module_name, init
  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 "apps\_dashboard\__init__.py", line 24, in 
error_storage = ErrorStorage()
  File "C:\wwwroot\py4web\py4web\core.py", line 690, in __init__
self.db = DAL(uri, folder=folder)
  File 
"C:\Users\salva\AppData\Roaming\Python\Python37\site-packages\pydal\base.py"
, line 171, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
  File 
"C:\Users\salva\AppData\Roaming\Python\Python37\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 
"C:\Users\salva\AppData\Roaming\Python\Python37\site-packages\pydal\base.py"
, line 457, in __init__
self._adapter = adapter(**kwargs)
  File 
"C:\Users\salva\AppData\Roaming\Python\Python37\site-packages\pydal\adapters\__init__.py"
, line 39, in __call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File 
"C:\Users\salva\AppData\Roaming\Python\Python37\site-packages\pydal\adapters\base.py"
, line 369, in __init__
super(SQLAdapter, self).__init__(*args, **kwargs)
  File 
"C:\Users\salva\AppData\Roaming\Python\Python37\site-packages\pydal\adapters\base.py"
, line 53, in __init__
self.reconnect()
  File 
"C:\Users\salva\AppData\Roaming\Python\Python37\site-packages\pydal\connection.py"
, line 154, in reconnect
self.connection = self.connector()
  File 
"C:\Users\salva\AppData\Roaming\Python\Python37\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


[ ] loading _default ...
 [A[X] loaded _default
[ ] loading _documentation ...
 [A[X] loaded _documentation
[ ] loading _minimal ...
 [A[X] loaded _minimal
[ ] loading _scaffold ...
 [A[FAILED] loading _scaffold
Traceback (most recent call last):
  File "C:\wwwroot\py4web\py4web\core.py", line 825, in import_app
module_name, init
  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 "apps\_scaffold\__init__.py", line 7, in 
from . models import db
  File "apps\_scaffold\models.py", line 5, in 
from .common import db, Field
  File "apps\_scaffold\common.py", line 102, in 
from celery import Celery
ModuleNotFoundError: No module named 'celery'

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


El jueves, 26 de diciembre de 2019, 18:56:22 (UTC+1), Massimo Di Pierro 
escribió:
>
> fixed!
>
> On Thursday, 26 December 2019 17:14:55 UTC+1, JSalvat wrote:
>>
>> Just installed from source but does not start:
>>
>> unzipped source to c:\wwwroot\py4web
>>
>> c:\wwwroot\py4web>python -m pip install -r requirements.txt --user
>> c:\wwwroot\py4web>python ./py4web-start.py apps
>> .
>> Is still experimental...
>>
>> Traceback (most recent call last):
>>   File "./py4web-start.py", line 6, in 
>> main()
>>   File "c:\wwwroot\py4web\py4web\core.py", line 1047, in main
>> initialize(**args.__dict__)
>>   File "c:\wwwroot\py4web\py4web\core.py", line 1008, in initialize
>> apps = os.listdir(assets_dir)
>> FileNotFoundError: [WinError 3] El sistema no puede encontrar la ruta 
>> especificada: 'c:\\wwwroot\\py4web\\py4web\\assets'
>>
>> c:\wwwroot\py4web>
>>
>> Yesterday's release worked fine?
>>
>>
>> El jueves, 26 de diciembre de 2019, 11:38:31 (UTC+1), Massimo Di Pierro 
>> escribió:
>>>
>>> I posted an example of possible use of celery with py4web (in _scaffold) 
>>> but I am not too happy about it.
>>>
>>> db._adapter.reconnect() should be automatic and 'apps._scaffold.tasks' 
>>> feels clunky.
>>>
>>> Anyway, the example shows how you can define tasks and they can import 
>>> anything they need from the app.
>>> Works well for me but help me test it some more.
>>>
>>> Massimo
>>>
>>>

-- 
Resources:
- http://web2py.com
- 

[web2py] Re: py4web and celery

2019-12-26 Thread Massimo Di Pierro
fixed!

On Thursday, 26 December 2019 17:14:55 UTC+1, JSalvat wrote:
>
> Just installed from source but does not start:
>
> unzipped source to c:\wwwroot\py4web
>
> c:\wwwroot\py4web>python -m pip install -r requirements.txt --user
> c:\wwwroot\py4web>python ./py4web-start.py apps
> .
> Is still experimental...
>
> Traceback (most recent call last):
>   File "./py4web-start.py", line 6, in 
> main()
>   File "c:\wwwroot\py4web\py4web\core.py", line 1047, in main
> initialize(**args.__dict__)
>   File "c:\wwwroot\py4web\py4web\core.py", line 1008, in initialize
> apps = os.listdir(assets_dir)
> FileNotFoundError: [WinError 3] El sistema no puede encontrar la ruta 
> especificada: 'c:\\wwwroot\\py4web\\py4web\\assets'
>
> c:\wwwroot\py4web>
>
> Yesterday's release worked fine?
>
>
> El jueves, 26 de diciembre de 2019, 11:38:31 (UTC+1), Massimo Di Pierro 
> escribió:
>>
>> I posted an example of possible use of celery with py4web (in _scaffold) 
>> but I am not too happy about it.
>>
>> db._adapter.reconnect() should be automatic and 'apps._scaffold.tasks' 
>> feels clunky.
>>
>> Anyway, the example shows how you can define tasks and they can import 
>> anything they need from the app.
>> Works well for me but help me test it some more.
>>
>> Massimo
>>
>>

-- 
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/84010871-c467-458a-8dd4-e7d207ebeef3%40googlegroups.com.


[web2py] Web2py survey ??

2019-12-26 Thread António Ramos
Hi all, i think that it could be important to question users about many
things to be known by us all.
I think it could serve not only for us that like and use web2py but for
others that dont know web2py and get that feeling "web2py what???" when you
suggest web2py .

Someone care for a google survey?
Questions to ask???

My contribution

Do you think web2py is dead? I get this a lot !!
What do you like about web2py  ?
what do you hate about web2py ?
How many users do you have in your web2py apps ? ( range - select...)
What db are you using with web2py ?? (from a list)
Have you used other framework ? which one? ( from a list)
What do you think that web2py has above other frameworks?

I guess you all could add a lot more to this list...

In the end Massimo could use it to show it next time he talks about
we2py/py4web
A good survey is a good publicity for a framework, do you agree ?

Regards
António

-- 
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/CAEM0BxNhdi0X1jG5iuTcP7fPAQE7xcebT%3DO3-cw9nb2AEXiOCw%40mail.gmail.com.


[web2py] Re: py4web and celery

2019-12-26 Thread JSalvat
Just installed from source but does not start:

unzipped source to c:\wwwroot\py4web

c:\wwwroot\py4web>python -m pip install -r requirements.txt --user
c:\wwwroot\py4web>python ./py4web-start.py apps
.
Is still experimental...

Traceback (most recent call last):
  File "./py4web-start.py", line 6, in 
main()
  File "c:\wwwroot\py4web\py4web\core.py", line 1047, in main
initialize(**args.__dict__)
  File "c:\wwwroot\py4web\py4web\core.py", line 1008, in initialize
apps = os.listdir(assets_dir)
FileNotFoundError: [WinError 3] El sistema no puede encontrar la ruta 
especificada: 'c:\\wwwroot\\py4web\\py4web\\assets'

c:\wwwroot\py4web>

Yesterday's release worked fine?


El jueves, 26 de diciembre de 2019, 11:38:31 (UTC+1), Massimo Di Pierro 
escribió:
>
> I posted an example of possible use of celery with py4web (in _scaffold) 
> but I am not too happy about it.
>
> db._adapter.reconnect() should be automatic and 'apps._scaffold.tasks' 
> feels clunky.
>
> Anyway, the example shows how you can define tasks and they can import 
> anything they need from the app.
> Works well for me but help me test it some more.
>
> Massimo
>
>

-- 
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/4392c4f9-50a5-4ebb-bec9-30518213c113%40googlegroups.com.


Re: [web2py] Re: py4web - cannot get logged in

2019-12-26 Thread Jim Steil
That fixed it.

Thanks Massimo

On Thu, Dec 26, 2019 at 2:17 AM Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Please try delete apps and then rerun "py4web-start apps". I suspect you
> have an older _dashboard.
> You may also try delete only apps/_dashboard and run "py4web-start -c
> apps". It will reinstall missing apps only.
>
> On Wednesday, 25 December 2019 21:30:42 UTC+1, Jim S wrote:
>>
>> Massimo
>>
>> I did the same,
>>
>> python3 -m pip install --upgrade py4web
>> py4web-start apps
>>
>> When I started, it asked for my password.  When I tried in the the login
>> page I again got the message about the env var not being set.  If I set the
>> env var to the same as my password (mine is only 2 characters, is that a
>> problem?), I have the same results as in the original message.
>>
>> I get the same behavior on my work computer and my home computer.  Both
>> running Ubuntu 19.10
>>
>> -Jim
>>
>> On Wednesday, December 25, 2019 at 12:45:06 PM UTC-6, Massimo Di Pierro
>> wrote:
>>>
>>> I posted a new version. Should solve this problem. Please let me know.
>>>
>>> On Thursday, 19 December 2019 17:14:20 UTC+1, Jim S wrote:

 python3 -m pip install --upgrade py4web
 py4web-start apps

 Entered my password

 Went to http://127.0.0.1:8000/_dashboard

 I am asked for a password - no matter what I do, I can't get past this
 page.

 At first I was getting this error:

 ERROR:root:Traceback (most recent call last):
   File "/home/jim/.local/lib/python3.7/site-packages/py4web/core.py",
 line 473, in wrapper
 ret = func(*func_args, **func_kwargs)
   File "/home/jim/.local/lib/python3.7/site-packages/py4web/core.py",
 line 439, in wrapper
 ret = func(*args, **kwargs)
   File "apps/_dashboard/__init__.py", line 56, in login
 valid = password and CRYPT()(password)[0] == os.environ[
 'PY4WEB_PASSWORD']
   File "/usr/lib/python3.7/os.py", line 679, in __getitem__
 raise KeyError(key) from None
 KeyError: 'PY4WEB_PASSWORD'

 I created the environment variable and stored my plain text password
 there.  Now this error is gone, but still not working.

 I can see that password.txt was created in the directory from which I
 initiated the py4web-start command.

 I restart py4web and the password still doesn't work.

 I deleted password.txt and restarted - was asked for the password and I
 entered it.

 Still no luck.

 I've had py4web running successfully in the past.  Just now sure what
 has happened now that is preventing me from logging in.

 -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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/hu6MRIMswEo/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/18ccda76-3f22-4a45-9564-3125044c05b9%40googlegroups.com
> 
> .
>

-- 
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/CAERBpoBVKwzCEHppJvukzqq94Dv5asLD22wAL-RW6GacopM90g%40mail.gmail.com.


[web2py] py4web and celery

2019-12-26 Thread Massimo Di Pierro
I posted an example of possible use of celery with py4web (in _scaffold) 
but I am not too happy about it.

db._adapter.reconnect() should be automatic and 'apps._scaffold.tasks' 
feels clunky.

Anyway, the example shows how you can define tasks and they can import 
anything they need from the app.
Works well for me but help me test it some more.

Massimo

-- 
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/d14e7c19-1311-40e3-80b4-b5db4b39daa3%40googlegroups.com.


[web2py] Re: Error 400 for Not authorized? Shouldn't we use 401?

2019-12-26 Thread Massimo Di Pierro
yes we should. fixed.

On Thursday, 19 December 2019 20:18:50 UTC+1, Tito Garrido wrote:
>
> Hi Guys,
>
> I am using AuthJWT from 
> https://github.com/web2py/web2py/blob/master/gluon/tools.py
> I could see that an expired token or not authorized token is 
> returning error 400. Shouldn't we use 401 - Unauthorized?
>
> https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401
>
> Thanks!
>
> 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/3c5c3e0b-29b8-46ec-a38d-872a8d5dc68e%40googlegroups.com.


[web2py] Re: py4web - cannot get logged in

2019-12-26 Thread Massimo Di Pierro
Please try delete apps and then rerun "py4web-start apps". I suspect you 
have an older _dashboard.
You may also try delete only apps/_dashboard and run "py4web-start -c 
apps". It will reinstall missing apps only.

On Wednesday, 25 December 2019 21:30:42 UTC+1, Jim S wrote:
>
> Massimo
>
> I did the same, 
>
> python3 -m pip install --upgrade py4web
> py4web-start apps
>
> When I started, it asked for my password.  When I tried in the the login 
> page I again got the message about the env var not being set.  If I set the 
> env var to the same as my password (mine is only 2 characters, is that a 
> problem?), I have the same results as in the original message.
>
> I get the same behavior on my work computer and my home computer.  Both 
> running Ubuntu 19.10
>
> -Jim
>
> On Wednesday, December 25, 2019 at 12:45:06 PM UTC-6, Massimo Di Pierro 
> wrote:
>>
>> I posted a new version. Should solve this problem. Please let me know.
>>
>> On Thursday, 19 December 2019 17:14:20 UTC+1, Jim S wrote:
>>>
>>> python3 -m pip install --upgrade py4web
>>> py4web-start apps
>>>
>>> Entered my password
>>>
>>> Went to http://127.0.0.1:8000/_dashboard
>>>
>>> I am asked for a password - no matter what I do, I can't get past this 
>>> page.
>>>
>>> At first I was getting this error:
>>>
>>> ERROR:root:Traceback (most recent call last):
>>>   File "/home/jim/.local/lib/python3.7/site-packages/py4web/core.py", 
>>> line 473, in wrapper
>>> ret = func(*func_args, **func_kwargs)
>>>   File "/home/jim/.local/lib/python3.7/site-packages/py4web/core.py", 
>>> line 439, in wrapper
>>> ret = func(*args, **kwargs)
>>>   File "apps/_dashboard/__init__.py", line 56, in login
>>> valid = password and CRYPT()(password)[0] == os.environ[
>>> 'PY4WEB_PASSWORD']
>>>   File "/usr/lib/python3.7/os.py", line 679, in __getitem__
>>> raise KeyError(key) from None
>>> KeyError: 'PY4WEB_PASSWORD'
>>>
>>> I created the environment variable and stored my plain text password 
>>> there.  Now this error is gone, but still not working.
>>>
>>> I can see that password.txt was created in the directory from which I 
>>> initiated the py4web-start command.
>>>
>>> I restart py4web and the password still doesn't work.
>>>
>>> I deleted password.txt and restarted - was asked for the password and I 
>>> entered it.
>>>
>>> Still no luck.  
>>>
>>> I've had py4web running successfully in the past.  Just now sure what 
>>> has happened now that is preventing me from logging in.
>>>
>>> -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/18ccda76-3f22-4a45-9564-3125044c05b9%40googlegroups.com.