[web2py] kpar for data configuration

2019-08-31 Thread Massimo Di Pierro
web2py had for long time a PluginManager class that almost nobody used.
I think it may have value beyond web2py so took it out and made this:

https://github.com/mdipierro/kpar/

Maybe some of you will find it useful. Feedback is appreciated. If you find 
typos, please report them to me.

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/27fc1748-fa13-4fc0-b834-a4898260b718%40googlegroups.com.


[web2py] Re: web3py -> py4web

2019-08-31 Thread Massimo Di Pierro
This is my bad. We just renamed

./py4web-start to ./py4web-start app.py

the reason is that windows did not understand the former. Does this solver 
the problems?

On Saturday, 31 August 2019 14:45:14 UTC-7, Klaus Zinser wrote:
>
> Thanks Val, thanks Massimo,
> as there was the chance to tidy up I took the approach from Massimo. 
>
> First I tried 
> py4web-start apps -> working
> ./py4web-start apps -> not working
> Then I tried to tidy up. Most realistic I 
> #1 deleted the venv (virtual environment), 
> #2 removed the folder 
> #3 uninstalled
> The I rebooted OSX. 
>
> When choosing 1) pip only I got these messages: 
>
> You are using pip version 19.0.3, however version 19.2.3 is available.
>
> You should consider upgrading via the 'pip install --upgrade pip' command.
>
> KlMcM:~ klausv.zinser$ pip install --upgrade pip
>
> DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 
> 2020. Please upgrade your Python as Python 2.7 won't be maintained after 
> that date. A future version of pip will drop support for Python 2.7. More 
> details about Python 2 support in pip, can be found at 
> https://pip.pypa.io/en/latest/development/release-process/#python-2-support
>
> Requirement already up-to-date: pip in 
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages 
> (19.2.3)
>
> KlMcM:~ klausv.zinser$ py4web-start apps
>
> -bash: py4web-start: command not found
> Neither ./py4web-start apps or py4web-start apps was working. 
>
> When reviewing what I had done before to install and what I uninstalled: 
> python3 
> -m pip uninstall py4web  
> I went for workflow 4) from source and install (as I had done this 
> before). 
> That was working,
>
> I don't want to take too much of your time. So this is fine for me. As I 
> am working on web2py with JSON and D3 I should try to have something 
> similar working. 
>
> But if you want me to test some issues let me know (pip only would be the 
> cleanest solution; again its fine what I have). 
>
> Klaus
>
>  
>
> Am Samstag, 31. August 2019 21:10:29 UTC+2 schrieb Massimo Di Pierro:
>>
>> I believe you have two (or three) versions installed. One installed from 
>> pip and one local (downloaded from github).
>>
>> when you start it with
>>
>> py4web-start apps
>>
>> (without the ./ you are using the pip installed one)
>> when you start it with
>>
>> ./py4web-start apps
>>
>> you are using the git one.
>> If you use source bin/activate it means you have a venv and maybe you 
>> have another version installed in the venv.
>>
>> One of those versions may be old and missing the py4web/__init__.py file.
>>
>> I recommend you cleanup house:
>> 1) remove the venv
>> 2) remove the py4web folder
>> 3) python3 -m pip uninstall py4web (from outside the py4web folder)
>>
>> Then choose what preferred workflow: pip, venv+pip, or source. Do not mix 
>> them up. If you want to try different workflows, use different folders. pip 
>> gets confused when you have the code checkout in the same folder where you 
>> run pip.
>>
>> workflow 1) pip only
>>
>> python3 -m pip install py4web
>> py4web-start apps
>> (apps will be created for you)
>>
>> workflow 2) venv+pip
>>
>> mkdir work
>> cd work
>> python3 -m venv venv
>> source venv/bin/activate
>> python -m pip install py4web
>> py4web-start apps
>> (apps will be created for you)
>>
>> workflow 3) from source
>>
>> git clone https://github.com/web2py/py4web.git
>>
>> cd py4web
>> make test
>> python3 ./py4web-start apps
>> (this will not create apps but will find the downloaded ones)
>>
>> workflow 4) from source and install
>>
>> git clone https://github.com/web2py/py4web.git
>>
>> cd py4web
>> make install
>> cd ..
>> mkdir work
>> cd work
>> py4web-start apps
>>
>>
>>
>> On Saturday, 31 August 2019 02:36:35 UTC-7, Klaus Zinser wrote:
>>>
>>> Using: 
>>> python3 -m pip install py4web --upgrade  worked. 
>>>
>>> But i was unsucessful with these two commands:
>>> source bin/activate 
>>>./py4web-start apps / 
>>>
>>> Then I used: 
>>>
>>> git clone https://github.com/web2py/py4web.git
>>> cd py4web
>>> python3 -m pip install -r requirements.txt
>>> python3 setup.py install
>>>
>>>
>>> and finelly: 
>>>
>>> py4web-start apps
>>>
>>>
>>> It came up but I was unsucessful when entering the requested one-time 
>>> dashboard password.
>>>
>>>
>>> KlMcM:py4web klausxx$ py4web-start apps
>>>
>>>
>>> ██╗ ██╗   ██╗██╗  ██╗██╗██╗███╗██╗
>>>
>>> ██╔══██╗╚██╗ ██╔╝██║  ██║██║██║██╔╝██╔══██
>>>
>>> ██╔╝ ╚╔╝ ███║██║ █╗ ██║█╗  ██╔╝
>>>
>>> ██╔═══╝   ╚██╔╝  ╚██║██║███╗██║██╔══╝  ██╔══██╗
>>>
>>> ██║██║██║╚███╔███╔╝███╗██╔╝
>>>
>>> ╚═╝╚═╝╚═╝ ╚══╝╚══╝ ╚══╝╚═╝ 
>>>
>>> It is still experimental...
>>>
>>> assets-folder: 
>>> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/py4web/assets
>>>
>>> Choose a one-time dashboad password: ONETIMEPW
>>>
>>> Dashboard is at: 

Re: [web2py] Re: Question with saving the thumbnail name on linux disk

2019-08-31 Thread Rahul Dhakate
To Add -

[Sat Aug 31 18:02:10.901023 2019] [wsgi:error] [pid 3810] [client
> 95.163.255.151:41074
> ]
> WARNING:root:Unable to write to file
> /home/www-data/web2py/applications/artpic/languages/ru.py
>

What's trying to write to this file?
[Rahul] This is not me. I am not trying to write anything to this file as I
dont use it - I donk know about it. I gave the write permissions to
language folder to resolve the issue. It got resolved and it is not showing
that error in the logs

I am not sure about the r artifact - I did not put anything like that.

Rahul


On Sun, Sep 1, 2019 at 5:15 AM Dave S  wrote:

>
>
> On Saturday, August 31, 2019 at 6:40:26 AM UTC-7, Rahul wrote:
>>
>> Hi Dave,
>> I finally found the issue where the magic was with default folder
>> path specified in db.py. I rectified it in code where-ever I had defined
>> for other upload types aswell and it works properly. Now the files do get
>> saved to the desired path.
>>
>
> Yay!
>
>
>
>> *but the THUMBNAIL file saving issue still persists on linux.* Again
>> this works properly in Windows.
>> [...]
>>
>
>
>> [Sat Aug 31 18:00:20.813518 2019] [wsgi:error] [pid 3806] [client
>> 42.108.232.228:38975] Cannot create thumbnail (un-recognized format)
>> for:  /home/www-data/web2py/applications/artpic/stati$
>>
>
> Hmmm 
>
>>
>> [Sat Aug 31 18:02:09.456898 2019] [wsgi:error] [pid 3810] [client
>> 95.163.255.151:41074] WARNING:root:Unable to write to file
>> /home/www-data/web2py/applications/artpic/languages/ru.py
>> [Sat Aug 31 18:02:09.685699 2019] [wsgi:error] [pid 3810] [client
>> 95.163.255.151:41074] WARNING:root:Unable to write to file
>> /home/www-data/web2py/applications/artpic/languages/ru.py
>> [Sat Aug 31 18:02:10.900764 2019] [wsgi:error] [pid 3810] [client
>> 95.163.255.151:41074] WARNING:root:Unable to write to file
>> /home/www-data/web2py/applications/artpic/languages/ru.py
>> [Sat Aug 31 18:02:10.901023 2019] [wsgi:error] [pid 3810] [client
>> 95.163.255.151:41074
>> ]
>> WARNING:root:Unable to write to file
>> /home/www-data/web2py/applications/artpic/languages/ru.py
>>
>
> What's trying to write to this file?
>
>
>
>> [...]
>>
> [Sat Aug 31 18:27:17.451565 2019] [wsgi:error] [pid 5696] [client
>> 42.108.232.228:34651] , referer:
>> http://artpic.in/upload-fotoz
>> [Sat Aug 31 18:27:17.451647 2019] [wsgi:error] [pid 5696] [client
>> 42.108.232.228:34651] infile:
>> /home/www-data/web2py/applications/artpic/static/user_uploads/fotoz.upload_photo.b404a9b372$
>> [Sat Aug 31 18:27:17.451668 2019] [wsgi:error] [pid 5696] [client
>> 42.108.232.228:34651] thumbnail_filename:  133.thumbnail.jpg, referer:
>> http://artpic.in/upload-fotoz
>> [Sat Aug 31 18:27:17.451690 2019] [wsgi:error] [pid 5696] [client
>> 42.108.232.228:34651] thumbpath and outfile:
>> /home/www-data/web2py/applications/artpic/static/thumbs/133.thumbnail.jpg,
>> r$
>> [Sat Aug 31 18:27:19.289744 2019] [wsgi:error] [pid 5696] [client
>> 42.108.232.228:34651] Cannot create thumbnail (un-recognized format)
>> for:  /home/www-data/web2py/applications/artpic/stati$
>>
>> *CODE - FOR THUMBNAIL*
>> [...]
>>
> except IOError:
>> print "Cannot create thumbnail (un-recognized format)
>> for: ", infile
>>
>>
>>  * Please suggest on how to get the thumbnail to save in debian box -
>> I'll try it again after removing the try and catch blocks and get*
>>
>>
> *raw ticket if any tomorrow*
>>
>
> Your except is not printing the exception itself, and what it does print
> is misleading (un-recognized format for an IOError?) and the filename
> printed may not be the one with the IOError.   First check ... make sure
> the thumbs directory exists and is writable. Is the ', r' appended to the
> line just an artifact of your logging tool? (I see "referer:
> hsttp://artpic.ini/upload-fotoz" on some other lines).
>
> You're definitely getting closer!
>
> /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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/Gn-cqZjDURk/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/b6bf42c1-6d57-4b53-ae8e-c963d116bdfc%40googlegroups.com
> 
> .
>

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

Re: [web2py] Re: Question with saving the thumbnail name on linux disk

2019-08-31 Thread Rahul Dhakate
Yes the thumbs directory exists and I have given all the rights to it.
Strange enough it did write a few files to this directory before. As I
mentioned before, the previous problem was that thumbnail file name was not
properly named, now it does not write to it at all. Also after the patch I
did yesterday I executed this command *chmod *... to give appropriate write
permissions to it again. I will remove the try catch block today to check
it gives me the raw error.

Thanks and regards

Rahul

On Sun, Sep 1, 2019 at 5:15 AM Dave S  wrote:

>
>
> On Saturday, August 31, 2019 at 6:40:26 AM UTC-7, Rahul wrote:
>>
>> Hi Dave,
>> I finally found the issue where the magic was with default folder
>> path specified in db.py. I rectified it in code where-ever I had defined
>> for other upload types aswell and it works properly. Now the files do get
>> saved to the desired path.
>>
>
> Yay!
>
>
>
>> *but the THUMBNAIL file saving issue still persists on linux.* Again
>> this works properly in Windows.
>> [...]
>>
>
>
>> [Sat Aug 31 18:00:20.813518 2019] [wsgi:error] [pid 3806] [client
>> 42.108.232.228:38975] Cannot create thumbnail (un-recognized format)
>> for:  /home/www-data/web2py/applications/artpic/stati$
>>
>
> Hmmm 
>
>>
>> [Sat Aug 31 18:02:09.456898 2019] [wsgi:error] [pid 3810] [client
>> 95.163.255.151:41074] WARNING:root:Unable to write to file
>> /home/www-data/web2py/applications/artpic/languages/ru.py
>> [Sat Aug 31 18:02:09.685699 2019] [wsgi:error] [pid 3810] [client
>> 95.163.255.151:41074] WARNING:root:Unable to write to file
>> /home/www-data/web2py/applications/artpic/languages/ru.py
>> [Sat Aug 31 18:02:10.900764 2019] [wsgi:error] [pid 3810] [client
>> 95.163.255.151:41074] WARNING:root:Unable to write to file
>> /home/www-data/web2py/applications/artpic/languages/ru.py
>> [Sat Aug 31 18:02:10.901023 2019] [wsgi:error] [pid 3810] [client
>> 95.163.255.151:41074
>> ]
>> WARNING:root:Unable to write to file
>> /home/www-data/web2py/applications/artpic/languages/ru.py
>>
>
> What's trying to write to this file?
>
>
>
>> [...]
>>
> [Sat Aug 31 18:27:17.451565 2019] [wsgi:error] [pid 5696] [client
>> 42.108.232.228:34651] , referer:
>> http://artpic.in/upload-fotoz
>> [Sat Aug 31 18:27:17.451647 2019] [wsgi:error] [pid 5696] [client
>> 42.108.232.228:34651] infile:
>> /home/www-data/web2py/applications/artpic/static/user_uploads/fotoz.upload_photo.b404a9b372$
>> [Sat Aug 31 18:27:17.451668 2019] [wsgi:error] [pid 5696] [client
>> 42.108.232.228:34651] thumbnail_filename:  133.thumbnail.jpg, referer:
>> http://artpic.in/upload-fotoz
>> [Sat Aug 31 18:27:17.451690 2019] [wsgi:error] [pid 5696] [client
>> 42.108.232.228:34651] thumbpath and outfile:
>> /home/www-data/web2py/applications/artpic/static/thumbs/133.thumbnail.jpg,
>> r$
>> [Sat Aug 31 18:27:19.289744 2019] [wsgi:error] [pid 5696] [client
>> 42.108.232.228:34651] Cannot create thumbnail (un-recognized format)
>> for:  /home/www-data/web2py/applications/artpic/stati$
>>
>> *CODE - FOR THUMBNAIL*
>> [...]
>>
> except IOError:
>> print "Cannot create thumbnail (un-recognized format)
>> for: ", infile
>>
>>
>>  * Please suggest on how to get the thumbnail to save in debian box -
>> I'll try it again after removing the try and catch blocks and get*
>>
>>
> *raw ticket if any tomorrow*
>>
>
> Your except is not printing the exception itself, and what it does print
> is misleading (un-recognized format for an IOError?) and the filename
> printed may not be the one with the IOError.   First check ... make sure
> the thumbs directory exists and is writable. Is the ', r' appended to the
> line just an artifact of your logging tool? (I see "referer:
> hsttp://artpic.ini/upload-fotoz" on some other lines).
>
> You're definitely getting closer!
>
> /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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/Gn-cqZjDURk/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/b6bf42c1-6d57-4b53-ae8e-c963d116bdfc%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 

[web2py] Re: Question with saving the thumbnail name on linux disk

2019-08-31 Thread Dave S


On Saturday, August 31, 2019 at 6:40:26 AM UTC-7, Rahul wrote:
>
> Hi Dave,
> I finally found the issue where the magic was with default folder 
> path specified in db.py. I rectified it in code where-ever I had defined 
> for other upload types aswell and it works properly. Now the files do get 
> saved to the desired path.
>

Yay!

 

> *but the THUMBNAIL file saving issue still persists on linux.* Again this 
> works properly in Windows.
> [...]
>
 

> [Sat Aug 31 18:00:20.813518 2019] [wsgi:error] [pid 3806] [client 
> 42.108.232.228:38975] Cannot create thumbnail (un-recognized format) 
> for:  /home/www-data/web2py/applications/artpic/stati$
>

Hmmm  

>
> [Sat Aug 31 18:02:09.456898 2019] [wsgi:error] [pid 3810] [client 
> 95.163.255.151:41074] WARNING:root:Unable to write to file 
> /home/www-data/web2py/applications/artpic/languages/ru.py
> [Sat Aug 31 18:02:09.685699 2019] [wsgi:error] [pid 3810] [client 
> 95.163.255.151:41074] WARNING:root:Unable to write to file 
> /home/www-data/web2py/applications/artpic/languages/ru.py
> [Sat Aug 31 18:02:10.900764 2019] [wsgi:error] [pid 3810] [client 
> 95.163.255.151:41074] WARNING:root:Unable to write to file 
> /home/www-data/web2py/applications/artpic/languages/ru.py
> [Sat Aug 31 18:02:10.901023 2019] [wsgi:error] [pid 3810] [client 
> 95.163.255.151:41074 
> ]
>  
> WARNING:root:Unable to write to file 
> /home/www-data/web2py/applications/artpic/languages/ru.py
>

What's trying to write to this file?

 

> [...] 
>
[Sat Aug 31 18:27:17.451565 2019] [wsgi:error] [pid 5696] [client 
> 42.108.232.228:34651] , referer: 
> http://artpic.in/upload-fotoz
> [Sat Aug 31 18:27:17.451647 2019] [wsgi:error] [pid 5696] [client 
> 42.108.232.228:34651] infile:  
> /home/www-data/web2py/applications/artpic/static/user_uploads/fotoz.upload_photo.b404a9b372$
> [Sat Aug 31 18:27:17.451668 2019] [wsgi:error] [pid 5696] [client 
> 42.108.232.228:34651] thumbnail_filename:  133.thumbnail.jpg, referer: 
> http://artpic.in/upload-fotoz
> [Sat Aug 31 18:27:17.451690 2019] [wsgi:error] [pid 5696] [client 
> 42.108.232.228:34651] thumbpath and outfile:  
> /home/www-data/web2py/applications/artpic/static/thumbs/133.thumbnail.jpg, 
> r$
> [Sat Aug 31 18:27:19.289744 2019] [wsgi:error] [pid 5696] [client 
> 42.108.232.228:34651] Cannot create thumbnail (un-recognized format) 
> for:  /home/www-data/web2py/applications/artpic/stati$
>
> *CODE - FOR THUMBNAIL*
> [...] 
>
except IOError:
> print "Cannot create thumbnail (un-recognized format) 
> for: ", infile
>
>
>  * Please suggest on how to get the thumbnail to save in debian box - 
> I'll try it again after removing the try and catch blocks and get*
>  
>
*raw ticket if any tomorrow*
>

Your except is not printing the exception itself, and what it does print is 
misleading (un-recognized format for an IOError?) and the filename printed 
may not be the one with the IOError.   First check ... make sure the thumbs 
directory exists and is writable. Is the ', r' appended to the line just an 
artifact of your logging tool? (I see "referer: 
hsttp://artpic.ini/upload-fotoz" on some other lines).

You're definitely getting closer!

/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/b6bf42c1-6d57-4b53-ae8e-c963d116bdfc%40googlegroups.com.


[web2py] Re: web3py -> py4web

2019-08-31 Thread Klaus Zinser
Thanks Val, thanks Massimo,
as there was the chance to tidy up I took the approach from Massimo. 

First I tried 
py4web-start apps -> working
./py4web-start apps -> not working
Then I tried to tidy up. Most realistic I 
#1 deleted the venv (virtual environment), 
#2 removed the folder 
#3 uninstalled
The I rebooted OSX. 

When choosing 1) pip only I got these messages: 

You are using pip version 19.0.3, however version 19.2.3 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.

KlMcM:~ klausv.zinser$ pip install --upgrade pip

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 
2020. Please upgrade your Python as Python 2.7 won't be maintained after 
that date. A future version of pip will drop support for Python 2.7. More 
details about Python 2 support in pip, can be found at 
https://pip.pypa.io/en/latest/development/release-process/#python-2-support

Requirement already up-to-date: pip in 
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages 
(19.2.3)

KlMcM:~ klausv.zinser$ py4web-start apps

-bash: py4web-start: command not found
Neither ./py4web-start apps or py4web-start apps was working. 

When reviewing what I had done before to install and what I uninstalled: 
python3 
-m pip uninstall py4web  
I went for workflow 4) from source and install (as I had done this before). 
That was working,

I don't want to take too much of your time. So this is fine for me. As I am 
working on web2py with JSON and D3 I should try to have something similar 
working. 

But if you want me to test some issues let me know (pip only would be the 
cleanest solution; again its fine what I have). 

Klaus

 

Am Samstag, 31. August 2019 21:10:29 UTC+2 schrieb Massimo Di Pierro:
>
> I believe you have two (or three) versions installed. One installed from 
> pip and one local (downloaded from github).
>
> when you start it with
>
> py4web-start apps
>
> (without the ./ you are using the pip installed one)
> when you start it with
>
> ./py4web-start apps
>
> you are using the git one.
> If you use source bin/activate it means you have a venv and maybe you have 
> another version installed in the venv.
>
> One of those versions may be old and missing the py4web/__init__.py file.
>
> I recommend you cleanup house:
> 1) remove the venv
> 2) remove the py4web folder
> 3) python3 -m pip uninstall py4web (from outside the py4web folder)
>
> Then choose what preferred workflow: pip, venv+pip, or source. Do not mix 
> them up. If you want to try different workflows, use different folders. pip 
> gets confused when you have the code checkout in the same folder where you 
> run pip.
>
> workflow 1) pip only
>
> python3 -m pip install py4web
> py4web-start apps
> (apps will be created for you)
>
> workflow 2) venv+pip
>
> mkdir work
> cd work
> python3 -m venv venv
> source venv/bin/activate
> python -m pip install py4web
> py4web-start apps
> (apps will be created for you)
>
> workflow 3) from source
>
> git clone https://github.com/web2py/py4web.git
>
> cd py4web
> make test
> python3 ./py4web-start apps
> (this will not create apps but will find the downloaded ones)
>
> workflow 4) from source and install
>
> git clone https://github.com/web2py/py4web.git
>
> cd py4web
> make install
> cd ..
> mkdir work
> cd work
> py4web-start apps
>
>
>
> On Saturday, 31 August 2019 02:36:35 UTC-7, Klaus Zinser wrote:
>>
>> Using: 
>> python3 -m pip install py4web --upgrade  worked. 
>>
>> But i was unsucessful with these two commands:
>> source bin/activate 
>>./py4web-start apps / 
>>
>> Then I used: 
>>
>> git clone https://github.com/web2py/py4web.git
>> cd py4web
>> python3 -m pip install -r requirements.txt
>> python3 setup.py install
>>
>>
>> and finelly: 
>>
>> py4web-start apps
>>
>>
>> It came up but I was unsucessful when entering the requested one-time 
>> dashboard password.
>>
>>
>> KlMcM:py4web klausxx$ py4web-start apps
>>
>>
>> ██╗ ██╗   ██╗██╗  ██╗██╗██╗███╗██╗
>>
>> ██╔══██╗╚██╗ ██╔╝██║  ██║██║██║██╔╝██╔══██
>>
>> ██╔╝ ╚╔╝ ███║██║ █╗ ██║█╗  ██╔╝
>>
>> ██╔═══╝   ╚██╔╝  ╚██║██║███╗██║██╔══╝  ██╔══██╗
>>
>> ██║██║██║╚███╔███╔╝███╗██╔╝
>>
>> ╚═╝╚═╝╚═╝ ╚══╝╚══╝ ╚══╝╚═╝ 
>>
>> It is still experimental...
>>
>> assets-folder: 
>> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/py4web/assets
>>
>> Choose a one-time dashboad password: ONETIMEPW
>>
>> Dashboard is at: http://127.0.0.1:8000/_dashboard
>>
>> Traceback (most recent call last):
>>
>>   File "/Library/Frameworks/Python.framework/Versions/3.7/bin/py4web-start", 
>> line 11, in 
>>
>> load_entry_point('py4web==0.1.20190826.1', 'console_scripts', 
>> 'py4web-start')()
>>
>>   File 
>> "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/py4web/core.py",
>>  line 816, in main
>>
>> Reloader.import_apps()
>>
>>   File 

[web2py] Re: web3py -> py4web

2019-08-31 Thread Massimo Di Pierro
I believe you have two (or three) versions installed. One installed from 
pip and one local (downloaded from github).

when you start it with

py4web-start apps

(without the ./ you are using the pip installed one)
when you start it with

./py4web-start apps

you are using the git one.
If you use source bin/activate it means you have a venv and maybe you have 
another version installed in the venv.

One of those versions may be old and missing the py4web/__init__.py file.

I recommend you cleanup house:
1) remove the venv
2) remove the py4web folder
3) python3 -m pip uninstall py4web (from outside the py4web folder)

Then choose what preferred workflow: pip, venv+pip, or source. Do not mix 
them up. If you want to try different workflows, use different folders. pip 
gets confused when you have the code checkout in the same folder where you 
run pip.

workflow 1) pip only

python3 -m pip install py4web
py4web-start apps
(apps will be created for you)

workflow 2) venv+pip

mkdir work
cd work
python3 -m venv venv
source venv/bin/activate
python -m pip install py4web
py4web-start apps
(apps will be created for you)

workflow 3) from source

git clone https://github.com/web2py/py4web.git

cd py4web
make test
python3 ./py4web-start apps
(this will not create apps but will find the downloaded ones)

workflow 4) from source and install

git clone https://github.com/web2py/py4web.git

cd py4web
make install
cd ..
mkdir work
cd work
py4web-start apps



On Saturday, 31 August 2019 02:36:35 UTC-7, Klaus Zinser wrote:
>
> Using: 
> python3 -m pip install py4web --upgrade  worked. 
>
> But i was unsucessful with these two commands:
> source bin/activate 
>./py4web-start apps / 
>
> Then I used: 
>
> git clone https://github.com/web2py/py4web.git
> cd py4web
> python3 -m pip install -r requirements.txt
> python3 setup.py install
>
>
> and finelly: 
>
> py4web-start apps
>
>
> It came up but I was unsucessful when entering the requested one-time 
> dashboard password.
>
>
> KlMcM:py4web klausxx$ py4web-start apps
>
>
> ██╗ ██╗   ██╗██╗  ██╗██╗██╗███╗██╗
>
> ██╔══██╗╚██╗ ██╔╝██║  ██║██║██║██╔╝██╔══██
>
> ██╔╝ ╚╔╝ ███║██║ █╗ ██║█╗  ██╔╝
>
> ██╔═══╝   ╚██╔╝  ╚██║██║███╗██║██╔══╝  ██╔══██╗
>
> ██║██║██║╚███╔███╔╝███╗██╔╝
>
> ╚═╝╚═╝╚═╝ ╚══╝╚══╝ ╚══╝╚═╝ 
>
> It is still experimental...
>
> assets-folder: 
> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/py4web/assets
>
> Choose a one-time dashboad password: ONETIMEPW
>
> Dashboard is at: http://127.0.0.1:8000/_dashboard
>
> Traceback (most recent call last):
>
>   File "/Library/Frameworks/Python.framework/Versions/3.7/bin/py4web-start", 
> line 11, in 
>
> load_entry_point('py4web==0.1.20190826.1', 'console_scripts', 
> 'py4web-start')()
>
>   File 
> "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/py4web/core.py",
>  line 816, in main
>
> Reloader.import_apps()
>
>   File 
> "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/py4web/core.py",
>  line 661, in import_apps
>
> 'apps', path).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 724, in exec_module
>
>   File "", line 859, in get_code
>
>   File "", line 916, in get_data
>
> FileNotFoundError: [Errno 2] No such file or directory: 
> '/Users/klausxx/py4web/apps/__init__.py'
>
> KlMcM:py4web klausxx$ 
>
>
> Klaus
>
>
>
> -
>
>
> Am Montag, 26. August 2019 19:05:24 UTC+2 schrieb En Ware:
>>
>> hmm , I just tried from pip and works find 
>>
>> python3 -m pip install py4web --upgrade 
>>
>> source bin/activate 
>>
>> ./py4web-start apps / 
>>
>>
>> ██╗ ██╗   ██╗██╗  ██╗██╗██╗███╗██╗ 
>> ██╔══██╗╚██╗ ██╔╝██║  ██║██║██║██╔╝██╔══██╗
>> ██╔╝ ╚╔╝ ███║██║ █╗ ██║█╗  ██╔╝
>> ██╔═══╝   ╚██╔╝  ╚██║██║███╗██║██╔══╝  ██╔══██╗
>> ██║██║██║╚███╔███╔╝███╗██╔╝
>> ╚═╝╚═╝╚═╝ ╚══╝╚══╝ ╚══╝╚═╝ 
>> It is still experimental...
>>
>> assets-folder: 
>> /Users/.env/python/py4web/lib/python3.6/site-packages/py4web/assets
>> Choose a one-time dashboad password: 
>> Dashboard is at: http://127.0.0.1:8000/_dashboard
>> [X] loaded _dashboard 
>> [X] loaded myapp 
>> [X] loaded _default 
>> [X] loaded _scaffold 
>> Bottle v0.12.17 server starting up (using TornadoServer())...
>> Listening on http://127.0.0.1:8000/
>> Hit Ctrl-C to quit.
>>
>>
>>
>> On Wednesday, August 21, 2019 at 10:51:31 AM UTC-5, Annet wrote:
>>>
>>>
>>> python3 setup.py install

>>>
>>> I installed py4web from source:
>>>
>>> git clone https://github.com/web2py/py4web.gitcd py4web
>>> python3 -m pip install -r 

Re: [web2py] Re: How do I display db text/string fields in the format in which they were entered on the form?

2019-08-31 Thread Patito Feo
Hi,

Im testing this, but it seems somethings changed to date. 

Here is what im getting on the textarea:

prueba textarea 3prueba textarea 3prueba textarea 3


As you can see, \n new lines are converted to  but render as .


Any suggestion?


Regards,



El jueves, 20 de octubre de 2016, 14:07:57 (UTC-5), Anthony escribió:
>
> Oops, forgot about the indenting -- just replace all spaces with "":
>
> {{=XML(site.other.replace('\n', '').replace(' ', ''),
>sanitize=True, permitted_tags=['br/'])}}
>
> Anthony
>
> On Thursday, October 20, 2016 at 2:29:51 PM UTC-4, Steven Vannoy wrote:
>>
>> Thanks, the replace option from @Anthony worked pretty well, it got the 
>> new lines but didn't provide indentation (as expected). The  
>> tags get both, and I like the font well enough except that it is a lighter 
>> gray on a gray background so if I can manage to get that changed I'll 
>> probably go with that option.
>>
>> Yes Dave, you were right it wasn't stripping the asterisks but wasn't 
>> rendering them the way I would like. 
>>
>> Steven
>>
>>
>> On Thu, Oct 20, 2016 at 2:07 PM, Anthony 
>> > wrote:
>>
>>> On Thursday, October 20, 2016 at 2:01:09 PM UTC-4, Dave S wrote:


 I'm going to go out on a limb, and opine that you never even get the 
 newlines or indentation (but do get the asterisks), all that having been 
 stripped out by the textarea input control.

>>>
>>> No, a textarea does preserve newlines.
>>>
>>> Anthony
>>>
>>> -- 
>>> 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/WM3hhsJVUYU/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> web...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/d76e579c-7cad-4fe9-b5ee-0248c44ca008%40googlegroups.com.


[web2py] Re: How to stopped redirection to user/login.html

2019-08-31 Thread Patito Feo
Any suggestion?


Cheers,


El jueves, 22 de agosto de 2019, 23:27:34 (UTC-5), Patito Feo escribió:
>
> Hi and thanks for your answer,
>
> I did what the manual points to do. But the redirection still points to 
> user/login.html. In fact here is part of my config:
>
> auth.settings.login_url = URL( 'ingreso' )
> auth.settings.logged_url = URL( 'preferencias')
>
> auth.settings.on_failed_authentication = lambda url: redirect( URL( 
> 'ingreso' ) )
>
>
> I have defined a auth custom table, is there anything Im missing?
>
>
> Regards,
>
> El jueves, 22 de agosto de 2019, 19:01:04 (UTC-5), Dave S escribió:
>>
>> On Thursday, August 22, 2019 at 4:32:02 PM UTC-7, Patito Feo wrote:
>>>
>>> Hi,
>>>
>>> This does not worked.
>>> Redirecting still goes to user/login.html.
>>>
>>> Any ideas?
>>>
>>> Cheers,
>>>
>>
>>
>> For a little more context, here's a larger quote form the book:
>>
>> If the visitor is not logger in, and calls a function that requires 
>>> authentication, the user is redirected to auth.settings.login_url which 
>>> defaults to URL('default', 'user/login'). One can replace this behavior by 
>>> redefining:
>>>
>>> auth.settings.on_failed_authentication = lambda url: redirect(url)
>>> This is the function called for the redirection. The argument url` 
>>> passed to this function is the url for the login page.
>>>
>>> If the visitor does not have permission to access a given function, the 
>>> visitor is redirect to the URL defined by
>>>
>>> auth.settings.on_failed_authorization = URL('user', 
>>> args='on_failed_authorization')
>>> You can change this variable and redirect the user elsewhere.
>>>
>>> Often on_failed_authorization is a URL but it can be a function that 
>>> returns the URL and it will be called on failed authorization.
>>>
>>
>>
>> from > http://web2py.com/books/default/chapter/29/09/access-control#Auth-Settings-and-messages
>> >
>>
>> Good luck!
>>
>> /dps
>>  
>>
>>>
>>> El jueves, 22 de agosto de 2019, 0:44:39 (UTC-5), Annet escribió:

 What about:

 auth.settings.on_failed_authentication = lambda url: redirect(url)


 That is what the book says changing the default behaviour.


 Kind regards,

 Annet





-- 
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/0dbd96f1-0145-4c43-8de1-bd71d0eedb85%40googlegroups.com.


[web2py] Re: web3py -> py4web

2019-08-31 Thread Val K
Yeah, I had the same issue, because there is no apps/__init__.py in the repo - 
just create 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/eab555d0-b628-41e6-8a22-b23e48648684%40googlegroups.com.


[web2py] Re: How to get rid if the /init/default/ in the URL?

2019-08-31 Thread Maurice Waka
Hi
This is a very good discussion.
I followed it and it worked for me.
However, I have multiple controllers with different views, How can I make 
it (HIDE ALL CONTROLLER NAMES) for all pages.
So far it only works for default/index
Kind regards
On Friday, November 3, 2017 at 2:31:00 PM UTC+3, Anthony wrote:
>
> On Thursday, November 2, 2017 at 9:47:35 PM UTC-4, Joe wrote:
>>
>> Yes, this is how the structure should look like, but it seems 
>> pythonanywhere doesn't allow me to setup the structure this way.
>>
>> If I try to use this path to install a new app: 
>> /home/username/web2py/applications
>>
>>
>> I get this pythonanywhere error msg during the process:
>> Enter the path for a new directory to contain the web2py code
>> failed to remove ‘/home/my_user_name/web2py/applications’: Directory not 
>> empty
>>
>
> What do you mean by "install a new app"? If you want to create a new app, 
> you can either use the web2py admin interface, or you can just go to the 
> Pythonanywhere "Files" tab in the dashboard, navigate to the 
> /web2py/applications directory, and enter a new directory name where it 
> says "Enter new directory name" (or you can just use a Bash console to 
> create a folder).
>
> If none of that is working for you, either contact Pythonanywhere support 
> or just create a new account.
>
> Anthony
>

-- 
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/1cf707de-b1ff-4813-b9d3-b9ce4afa98eb%40googlegroups.com.


[web2py] Re: web3py -> py4web

2019-08-31 Thread pollwerk
Using: 
python3 -m pip install py4web --upgrade  worked. 

But i was unsucessful with these two commands:
source bin/activate 
   ./py4web-start apps / 

Then I used: 

git clone https://github.com/web2py/py4web.git
cd py4web
python3 -m pip install -r requirements.txt
python3 setup.py install


and finelly: 

py4web-start apps


It came up but I was unsucessful when entering the requested one-time dashboard 
password.


KlMcM:py4web klausxx$ py4web-start apps


██╗ ██╗   ██╗██╗  ██╗██╗██╗███╗██╗ 

██╔══██╗╚██╗ ██╔╝██║  ██║██║██║██╔╝██╔══██╗

██╔╝ ╚╔╝ ███║██║ █╗ ██║█╗  ██╔╝

██╔═══╝   ╚██╔╝  ╚██║██║███╗██║██╔══╝  ██╔══██╗

██║██║██║╚███╔███╔╝███╗██╔╝

╚═╝╚═╝╚═╝ ╚══╝╚══╝ ╚══╝╚═╝ 

It is still experimental...


assets-folder: 
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/py4web/assets

Choose a one-time dashboad password: ONETIMEPW

Dashboard is at: http://127.0.0.1:8000/_dashboard

Traceback (most recent call last):

  File "/Library/Frameworks/Python.framework/Versions/3.7/bin/py4web-start", 
line 11, in 

load_entry_point('py4web==0.1.20190826.1', 'console_scripts', 
'py4web-start')()

  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/py4web/core.py",
 line 816, in main

Reloader.import_apps()

  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/py4web/core.py",
 line 661, in import_apps

'apps', path).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 724, in exec_module

  File "", line 859, in get_code

  File "", line 916, in get_data

FileNotFoundError: [Errno 2] No such file or directory: 
'/Users/klausv.zinser/py4web/apps/__init__.py'

KlMcM:py4web klausxx$ 


Klaus


Am Montag, 26. August 2019 19:05:24 UTC+2 schrieb En Ware:
>
> hmm , I just tried from pip and works find 
>
> python3 -m pip install py4web --upgrade 
>
> source bin/activate 
>
> ./py4web-start apps / 
>
>
> ██╗ ██╗   ██╗██╗  ██╗██╗██╗███╗██╗ 
> ██╔══██╗╚██╗ ██╔╝██║  ██║██║██║██╔╝██╔══██╗
> ██╔╝ ╚╔╝ ███║██║ █╗ ██║█╗  ██╔╝
> ██╔═══╝   ╚██╔╝  ╚██║██║███╗██║██╔══╝  ██╔══██╗
> ██║██║██║╚███╔███╔╝███╗██╔╝
> ╚═╝╚═╝╚═╝ ╚══╝╚══╝ ╚══╝╚═╝ 
> It is still experimental...
>
> assets-folder: 
> /Users/.env/python/py4web/lib/python3.6/site-packages/py4web/assets
> Choose a one-time dashboad password: 
> Dashboard is at: http://127.0.0.1:8000/_dashboard
> [X] loaded _dashboard 
> [X] loaded myapp 
> [X] loaded _default 
> [X] loaded _scaffold 
> Bottle v0.12.17 server starting up (using TornadoServer())...
> Listening on http://127.0.0.1:8000/
> Hit Ctrl-C to quit.
>
>
>
> On Wednesday, August 21, 2019 at 10:51:31 AM UTC-5, Annet wrote:
>>
>>
>> python3 setup.py install
>>>
>>
>> I installed py4web from source:
>>
>> git clone https://github.com/web2py/py4web.gitcd py4web
>> python3 -m pip install -r requirements.txt
>> python3 setup.py install
>>
>>
>> Running the last statement gives the following errors:
>>
>> byte-compiling 
>> build/bdist.macosx-10.9-x86_64/egg/py4web/utils/auth_plugins/saml2_plugin.py 
>> to saml2_plugin.cpython-37.pyc
>>   File 
>> "build/bdist.macosx-10.9-x86_64/egg/py4web/utils/auth_plugins/saml2_plugin.py",
>>  
>> line 105
>> session.saml_outstanding_queries = {req_id: request.url}
>>^
>> SyntaxError: invalid syntax
>>
>> and
>>
>> Extracting py4web-0.1.20190818.2-py3.7.egg to 
>> /usr/local/lib/python3.7/site-packages
>>   File 
>> "/usr/local/lib/python3.7/site-packages/py4web-0.1.20190818.2-py3.7.egg/py4web/utils/auth_plugins/saml2_plugin.py",
>>  
>> line 105
>> session.saml_outstanding_queries = {req_id: request.url}
>>^
>> SyntaxError: invalid syntax
>>
>>
>>
>> I starting py4web 
>>
>> py4web-start apps
>>
>>
>> fails with the following error:
>>
>> FileNotFoundError: [Errno 2] No such file or directory: 
>> '/Users/me/py4web/apps/__init__.py'
>>
>>
>> How do I resolve these issues?
>>
>>
>> Kind regards,
>>
>> Annet
>>
>

-- 
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/6fb376ca-9ab2-46e5-a19a-d9ef5847628b%40googlegroups.com.