[web2py] Re: Front end framework

2024-02-16 Thread Massimo Di Pierro
I do not know how much different 4 and 5 are. Only the names of the classes 
in the forms may be an issue. I would recommend you try it with BS 5 and if 
you run into any issue it may be possible to address it with a new adapter 
or, maybe easier, a few lines of JS.

On Monday 12 February 2024 at 08:11:57 UTC-8 gaelpri...@gmail.com wrote:

> Hello all.
>
> I've to update a Web2py app that uses Bootstrap 2.3.2.
>
> Now the Web2py 2.27.1 uses Bootstrap 4?
>
> Is it possible to use Bootstrap 5?
>
> Thanks.
>

-- 
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/2bab27fc-ddc7-4599-9cc4-13166f847f16n%40googlegroups.com.


[web2py] Re: Exception Error: 'Field' object has no attribute '__dir__'

2023-12-28 Thread Massimo Di Pierro
This is fixed in master, although I failed to reproduce. Thanks for 
reporting it and suggesting the fix.

On Tuesday 12 December 2023 at 02:06:28 UTC-8 mostwanted wrote:

> Is there something wrong with the upload functionality or is just my app?
>
> On Friday, December 8, 2023 at 7:39:49 PM UTC+2 mostwanted wrote:
>
>> Hi guys, I recently 'upgraded' my web2py version to the latest version 
>> (2.27.1) but i've forgotten the previous version. Now suddenly when i try 
>> to submit forms i get this error:   'Field' object has no attribute 
>> '__dir__'
>>
>> Below is the tracebeack
>> Traceback
>> Traceback (most recent call last):
>> File "/home/sesoa/web2py/gluon/restricted.py", line 219, in restricted
>> exec(ccode, environment)
>> File "/home/sesoa/web2py/applications/init/controllers/default.py" 
>> , 
>> line 920, in 
>> File "/home/sesoa/web2py/gluon/globals.py", line 463, in 
>> self._caller = lambda f: f()
>> File "/home/sesoa/web2py/applications/init/controllers/default.py" 
>> , 
>> line 315, in business_registration
>> if form.process().accepted:
>> File "/home/sesoa/web2py/gluon/html.py", line 2410, in process
>> self.validate(**kwargs)
>> File "/home/sesoa/web2py/gluon/html.py", line 2349, in validate
>> if self.accepts(**kwargs):
>> File "/home/sesoa/web2py/gluon/sqlhtml.py", line 2132, in accepts
>> source_file, original_filename, field.uploadfolder
>> File "/home/sesoa/web2py/gluon/packages/dal/pydal/objects.py", line 2075, 
>> in store
>> self._tablename if '_tablename' in self.__dir__() and self._tablename else 
>> 'no_table',
>> AttributeError: 'Field' object has no attribute '__dir__'
>>
>

-- 
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/e5cfd59e-99ed-4721-8f94-573fa7261c3bn%40googlegroups.com.


[web2py] Re: web2py 2.27.1 released

2023-12-28 Thread Massimo Di Pierro
yes. sorry had forgotten to push the tags.

-- 
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/add105d1-02aa-46fb-8567-50825c28b8fdn%40googlegroups.com.


[web2py] Re: is upgrade still experimental ?

2023-12-28 Thread Massimo Di Pierro
I think it will always be experimental. I do not want to take any 
responsibility for breaking your local installation. :-)

On Monday 20 November 2023 at 06:20:33 UTC-8 Ramos wrote:

> hello is the upgrade button still experimental ?
> [image: image.png]
>
>
>
> [image: image.png]
>
> 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/9f682799-3867-46a7-9354-bcd47f192907n%40googlegroups.com.


[web2py] web2py 2.27.1 released

2023-11-16 Thread Massimo Di Pierro
web2py 2.27.1 was released

- some linting and formatting
- added support to Python 3.11
- fixed regexen and classname
- removed a circular dependency

-- 
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/972e2ca2-a290-462f-b3d5-5f672681889dn%40googlegroups.com.


[web2py] web2py 2.26.1 released

2023-10-29 Thread Massimo Di Pierro
Changelog:
- adds support of python up to version 3.11
- fixes a bug with serialization of headers introduced in version 2.25.1
- improves handling of unstable db connections in the scheduler

I remind you that py4web has been out for 5 years now as successor of 
web2py.
It has the same template language and dal as web2py but it is a lot faster.
It has a better grid, form handling, and auth integrations.

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/46c7b720-ef38-48c7-b483-5f0b14a1d0efn%40googlegroups.com.


[web2py] Re: web2py 2.25.1 - bug when running interactive shell?

2023-10-29 Thread Massimo Di Pierro
It should be abspath and should be fixed in master. I plan to release a new 
version today.

On Friday, 27 October 2023 at 01:28:59 UTC-7 Tom Clerckx wrote:

> I believe web2py/gluon/shell.py", line 238 should use os.path.*abspath* 
> instead of *absdir*?
>
> Unpacked and ran a clean version of web2py:
>
> command: python web2py.py -B -S welcome -M
>
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2023
> Version 2.25.1-stable+timestamp.2023.10.08.18.44.43
> Database drivers available: sqlite3, imaplib, pymysql, pyodbc
> Traceback (most recent call last):
>   File "/odindrive/temp/web2pytest/web2py/web2py.py", line 58, in 
> gluon.widget.start()
>   File "/odindrive/temp/web2pytest/web2py/gluon/widget.py", line 746, in 
> start
> run(options.shell, plain=options.plain, bpython=options.bpython,
>   File "/odindrive/temp/web2pytest/web2py/gluon/shell.py", line 238, in run
> adir = os.path.absdir(os.path.join('applications', a))
> AttributeError: module 'posixpath' has no attribute 'absdir'. Did you 
> mean: 'isdir'?
>

-- 
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/ce3db034-2211-4803-b4a0-7cfb2a7en%40googlegroups.com.


[web2py] Re: Web2py move to a new server resulted in this 'CommonDialect' object has no attribute 'eq'

2023-10-29 Thread Massimo Di Pierro
This is a know issue with has been fixed in master. I will release a new 
version later today.

On Sunday, 22 October 2023 at 02:07:32 UTC-7 vald...@gmail.com wrote:

> Whenever I reload, It seems to create a new thread showing this in the CLI.
>
> For example, when I attempt to run the app, the error, shown below, starts 
> with: " ERROR:Rocket.Errors.Thread-2:Traceback (most recent call last):"
> The next time it runs showing " ERROR:Rocket.Errors.Thread-4:Traceback 
> (most recent call last):"
> Then " ERROR:Rocket.Errors.Thread-6:Traceback (most recent call last):"
>
> And so on. 
>
> Here is a dump from the CLI. Everything below the traceback line remains 
> the same:
>
> Starting server...
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2023
> Version 2.25.1-stable+timestamp.2023.10.08.18.44.43
> Database drivers available: sqlite3, imaplib, pymysql
>
> please visit:
> http://127.0.0.1:8005/
> use "kill -SIGTERM 161098" to shutdown the web2py server
>
>
> ERROR:Rocket.Errors.Thread-2:Traceback (most recent call last):
>
>   File "/home/support/cts-new/cts_py3/web2py/gluon/rocket.py", line 1294, 
> in run
> self.run_app(conn)
>
>   File "/home/support/cts-new/cts_py3/web2py/gluon/rocket.py", line 1796, 
> in run_app
> output = self.app(environ, self.start_response)
>
>   File "/home/support/cts-new/cts_py3/web2py/gluon/main.py", line 648, in 
> app_with_logging
> ret[0] = wsgiapp(environ, responder2)
>
>   File "/home/support/cts-new/cts_py3/web2py/gluon/main.py", line 562, in 
> wsgibase
> return http_response.to(responder, env=env)
>
>   File "/home/support/cts-new/cts_py3/web2py/gluon/http.py", line 129, in 
> to
> responder(status, rheaders)
>
>   File "/home/support/cts-new/cts_py3/web2py/gluon/main.py", line 643, in 
> responder2
> return responder(s, h)
>
>   File "/home/support/cts-new/cts_py3/web2py/gluon/rocket.py", line 1759, 
> in start_response
> self.header_set = Headers(response_headers)
>
>   File "/usr/lib/python3.10/wsgiref/headers.py", line 39, in __init__
> self._convert_string_type(v)
>
>   File "/usr/lib/python3.10/wsgiref/headers.py", line 45, in 
> _convert_string_type
> raise AssertionError("Header names/values must be"
>
> AssertionError: Header names/values must be of type str (got 50)
>
> On Sunday, October 22, 2023 at 3:53:47 AM UTC-5 vald...@gmail.com wrote:
>
>> It's as if any attempt to read tables based on the db object causes this 
>> error.
>>
>> I was getting this error where IS_IN_DB that references other tables as 
>> base tables. I've moved all those references from the models completely and 
>> now I'm getting the error when I attempt to log in to the app.
>>
>> Very strange
>>
>> On Saturday, October 21, 2023 at 4:45:09 PM UTC-5 vald...@gmail.com 
>> wrote:
>>
>>> Hi Guys,
>>>
>>> I recently upgraded an app I wrote with web2py about 4 years ago to work 
>>> with Python 3.
>>> I got a lot of this   'CommonDialect' object 
>>> has no attribute 'eq' error until I removed the requires=IS_IN_DB() 
>>> references to other tables and put the majority of the references into a 
>>> separate model file named so it would load last. It now works on my local 
>>> machine.
>>> I've since moved the code to the production server and it worked at 
>>> first and then the same error started again, this time with it having a 
>>> problem with the model file that was set to load last. I have tried 
>>> deleting the web2py installation downloaded a fresh copy to no avail.
>>>
>>> Please help.
>>>
>>>
>>>

-- 
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/13a164e9-cbef-4a0d-af56-abe88e413a95n%40googlegroups.com.


[web2py] Re: AssertionError: Header names/values must be of type str

2023-10-25 Thread Massimo Di Pierro
I believe this is now fixed in master, thanks to Carlos' suggestion. Can 
you please give it a try?

On Monday, 23 October 2023 at 13:30:34 UTC-7 alex wrote:

> Hi, Running web2py in virtualenviroment (python 3.9.5, it happens also in 
> python 3.10.10)
>
> 
>
> ERROR:Rocket.Errors.Thread-3:Traceback (most recent call last):
>
>   File "/Users/z/dev/web2py/gluon/rocket.py", line 1294, in run
> self.run_app(conn)
>
>   File "/Users/z/dev/web2py/gluon/rocket.py", line 1796, in run_app
> output = self.app(environ, self.start_response)
>
>   File "/Users/z/dev/web2py/gluon/main.py", line 648, in app_with_logging
> ret[0] = wsgiapp(environ, responder2)
>
>   File "/Users/z/dev/web2py/gluon/main.py", line 562, in wsgibase
> return http_response.to(responder, env=env)
>
>   File "/Users/z/dev/web2py/gluon/http.py", line 129, in to
> responder(status, rheaders)
>
>   File "/Users/z/dev/web2py/gluon/main.py", line 643, in responder2
> return responder(s, h)
>
>   File "/Users/z/dev/web2py/gluon/rocket.py", line 1759, in start_response
> self.header_set = Headers(response_headers)
>
>   File "/Users/z/.pyenv/versions/3.9.5/lib/python3.9/wsgiref/headers.py", 
> line 39, in __init__
> self._convert_string_type(v)
>
>   File "/Users/z/.pyenv/versions/3.9.5/lib/python3.9/wsgiref/headers.py", 
> line 45, in _convert_string_type
> raise AssertionError("Header names/values must be"
>
> AssertionError: Header names/values must be of type str (got 50)
>
> 
> Any hints? 
> Thank you
>

-- 
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/2f971066-7e75-440e-80e0-cc132afacc93n%40googlegroups.com.


[web2py] Re: File Download Broken after Pull Request #2471

2023-10-25 Thread Massimo Di Pierro
I agree with you. I committed your proposed change to master. Please 
confirm this indeed fixes it and I will make another release.

On Wednesday, 4 October 2023 at 08:26:46 UTC-7 CarlosDB wrote:

> Hello,
>
> Today, I downloaded web2py from GitHub to start testing a future update. I 
> have several "upload" fields for images, and they have all started to fail.
>
> After some investigation, I found that this issue started after Pull 
> Request (PR) #2471 (Sanitize Headers) was merged. Link to PR 
> .
>  
> This PR modifies the file gluon/http.py.
>
> The following code:
> @cache.action(time_expire=86400)
> def download():
> return response.download(request, db)
>
> has stopped working.
>
> If I remove the line "@cache.action(time_expire=86400)", it works, but 
> that's not a good solution.
>
> While investigating the root of the problem, I found the issue around line 
> 123 of gluon/http.py. It used to be like this:
>
> rheaders = []
> for k, v in iteritems(headers):
> if isinstance(v, list):
> rheaders += [(k, item) for item in v]
> else:
> rheaders.append((k, v))
> responder(status, rheaders)
>
> Now it looks like this:
>
> rheaders = []
> for k, v in iteritems(headers):
> if isinstance(v, list):
> rheaders += [(k, str(item)) for item in v]
> elif v is not None:
> rheaders.append((k, str(v)))
> responder(status, rheaders)
>
>
> The variable "rheaders" contains the HTTP headers, but with these 
> modifications, some values are int or None, but they should be str. For 
> example:
> ('Content-Length', 29563)
> ('Pragma', None)
>
> ('Content-Length', 29563) should be ('Content-Length', '29563'), and I 
> believe ('Pragma', None) is a deprecated header that should be removed.
>
> A possible solution could be to revert part of the PR, but I think there 
> might be a better solution.
>
> The real issue seems to originate from the files gluon/streamer.py and 
> gluon/cache.py. I have commented on the lines that have problems:
>
> *In gluon/streamer.py, line 127*:
>
> # in all the other cases (not 304, not 206, but 200 or error page)
> if status != 206:
> enc = request.env.http_accept_encoding
> if enc and 'gzip' in enc and not 'Content-Encoding' in headers:
> gzipped = static_file + '.gz'
> if os.path.isfile(gzipped) and os.path.getmtime(gzipped) >= 
> modified:
> static_file = gzipped
> fsize = os.path.getsize(gzipped)
> headers['Content-Encoding'] = 'gzip'
> headers['Vary'] = 'Accept-Encoding'
> try:
> stream = open(static_file, 'rb')
> except IOError as e:
> # this better not happen when returning an error page ;-)
> if e.errno in (errno.EISDIR, errno.EACCES):
> raise HTTP(403)
> else:
> raise HTTP(404)
> headers['Content-Length'] = fsize   # should be: 
> headers['Content-Length'] = str(fsize)
>
> *In gluon/cache.py, line 676:*
>
> if send_headers:
> headers = {'Pragma': None,  # Deprecated: This 
> feature is no longer recommended
>'Expires': expires,
>'Cache-Control': cache_control}
>
>
> What is your opinion?
> Best way to solve it? 
>
> Carlos.

-- 
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/67791b69-f9c6-41cc-a663-0951d8288127n%40googlegroups.com.


[web2py] Re: app not loading external python library

2023-10-25 Thread Massimo Di Pierro
Hello Alex,

thank for reporting this problem. Is it only occurring with web2py 2.25.1? 

On Monday, 23 October 2023 at 14:05:15 UTC-7 alex wrote:

> Hi, 
>
> I am running web2py Version 2.25.1-stable in virtualenv (python 3.9.5, it 
> happens also in python 3.10.10)
>
> After activating the virtualenv, I installed requests
>
> $ pip install request
> $ pip show requests
> Name: requests
> Version: 2.31.0
> Summary: Python HTTP for Humans.
> Home-page: https://requests.readthedocs.io
> Author: Kenneth Reitz
> Author-email: m...@kennethreitz.org
> License: Apache 2.0
> Location: 
> /Users/z/dev/web2py/.direnv/python-3.9/lib/python3.9/site-packages
> Requires: certifi, charset-normalizer, idna, urllib3
> Required-by:
>
> Importing requests from bpython gives no errors.
>
> Importing requests in myapp gives an error.
> I also tried with other external libraries, some of them do work, some 
> others cannot be imported.
>
> About this case, I have tried the following: 
>
> In "web2py/applications/myapp/models/0.py":
>
> # - - - - - - - - - - - - - - -
>
> # added the virtualenv path to sys.path
>
> site_package_path = 
> "/Users/z/dev/web2py/.direnv/python-3.9/lib/python3.9/site-packages"
>
> if site_package_path not in sys.path:
> sys.path.append(site_package_path)
>
> try:
> import requests
> except:
> raise Exception('import error: "requests" not found')
>
>
> # - - - - - - - - - - - - - - -
>
> I am running web2py with: 
>
> $python web2py.py -a 'pwd'
>
> Error log:
>
> # - - - - - - - - - - - - - - -
> Ticket ID
> 127.0.0.1.2023-10-24.05-48-51.a557dcfb-55a3-4063-ac27-879cad8fe799
>
>  import error: "requests" not found
> Version
> web2py™ Version 2.25.1-stable+timestamp.2023.10.08.18.44.43
> Python Python 3.9.5: /Users/z/dev/web2py/.direnv/python-3.9/bin/python 
> (prefix: /Users/z/dev/web2py/.direnv/python-3.9)
>
> ...
>
> Traceback (most recent call last):
>   File "/Users/z/dev/web2py/gluon/custom_import.py", line 78, in 
> custom_importer
> result = sys.modules[modules_prefix]
> KeyError: 'applications.wh.modules.requests'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "/Users/z/dev/web2py/applications/wh/models/0.py", line 29, in 
> 
> import requests
>   File "/Users/z/dev/web2py/gluon/custom_import.py", line 80, in 
> custom_importer
> raise ImportError("No module named %s" % modules_prefix)
> ImportError: No module named applications.wh.modules.requests
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "/Users/z/dev/web2py/gluon/restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File "/Users/z/dev/web2py/applications/wh/models/0.py", line 31, in 
> 
> raise Exception('import error: "requests" not found')
> Exception: import error: "requests" not found
> Error snapshot help
> Exception(import error: "requests" not found)
>
> inspect attributes
>
> Exception instance attributes
> __cause__ None
> __class__ 
> __context__ ImportError('No module named 
> applications.wh.modules.requests')
> __delattr__ 
> __dict__ {}
> __dir__ 
> __doc__ 'Common base class for all non-exit exceptions.'
> __eq__ 
> __format__ 
> __ge__ 
> __getattribute__ 
> __gt__ 
> __hash__ 
> __init__ 
> __init_subclass__ 
> __le__ 
> __lt__ 
> __ne__ 
> __new__ 
> __reduce__ 
> __reduce_ex__ 
> __repr__ 
> __setattr__ 
> __setstate__ 
> __sizeof__ 
> __str__ 
> __subclasshook__ 
> __suppress_context__ False
> __traceback__ 
> args ('import error: "requests" not found',)
> with_traceback 
> Frames
> File /Users/z/dev/web2py/gluon/restricted.py in restricted at line 219 
> code arguments variables
>
> File /Users/z/dev/web2py/applications/wh/models/0.py in  at line 
> 31 code arguments variables
>
> Function argument list
> ()
>
> Context locals
>
> ...
>
>
> 
> iteritems : 
> >
> local_import : 
> .>
> myconf : 
> {'app': {'name': 'WH', 'author': 'Your Name  'bootstrap3_inline', 'separator': ''}}
> redirect : 
> 
> reduce : 
> 
> request : 
> , 
> '_custom_import_track_changes': True}>
> response : 
>  'view': 'default/index.html'}>
> session : 
> 
> site_package_path : 
> "'/Users/z/dev/web2py/.direnv/python-3.9/lib/python3.9/site-packages'"
> sys : 
> 
> to_bytes : 
> 
> to_native : 
> 
> track_changes : 
> 
> xmlescape : 
> 
> xrange : 
> 
> session
> response
> body : 
> <_io.StringIO object at 0x10509de50>
> cookies : 
> session_id_wh : 
> 127.0.0.1-3599de20-98fe-4a6f-a572-aa7d12f28231
> comment : 
> domain : 
> expires : 
> httponly : 
> max-age : 
> path : 
> /
> samesite : 
> secure : 
> version : 
> delimiters : 
> {{
> }}
> files : 
> flash : 
> form_label_separator : 
> :
> formstyle : 
> table3cols
> generic_patterns : 
> *
> headers : 
> X-Powered-By : 
> web2py
> menu : 
> meta : 
> models_to_run : 
> ^\w+\.py$
> ^default/\w+\.py$
> ^default/index/\w+\.py$
> postprocessing : 
> session_client : 
> 127.0.0.1
> 

[web2py] web2py 2.25.1

2023-10-08 Thread Massimo Di Pierro
Hello everybody,

A new version of web2py, 2.25.1, is out. 

It contains some bug fixes, #2468 #2468 #2236, http headers sanitization, 
and fixes this vulenarbility https://jvn.jp/en/jp/JVN80476432/ (to be 
published soon).

The vulnerabily does not affect most users. It is only in the optional 
MessageBoxHandler for logging when using Tkinter. I do know think anybody 
is was using it.

I am reviewing some old PRs and I may have another version out today 
including those fixes as well. Sorry I have been slow but as you know, I am 
spending more time on py4web than web2py these days. 

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/07157d0b-2486-47df-b83a-36d5e1282866n%40googlegroups.com.


[web2py] web2py 2.24.1 released

2023-03-22 Thread Massimo Di Pierro
Hello everybody,

web2py 2.24.1 has been released.

Thanks to Leonel, Cem, and Mark for bug fixes including:
- handling corrupt disk cache
- broken application packaging
- compare function logic


-- 
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/72adab7e-da20-4d20-929f-3c8dd9f6ca4dn%40googlegroups.com.


[web2py] Re: web2py 2.23.0 is giving a 403 error when I try to package my applications

2023-03-22 Thread Massimo Di Pierro
This has been fixed and 2.24.1 released. My apologies for overlooking the 
issue.

On Sunday, 26 February 2023 at 05:51:30 UTC-8 pcwa...@comcast.net wrote:

> I submitted an issue #2457  
> a month ago. Please leverage that one.
>
> On Monday, February 13, 2023 at 12:28:40 AM UTC-7 david@gmail.com 
> wrote:
>
>> Hi pcg,
>>
>> I also created a bug report for this one and got a message from Massimo 
>> that it would be fixed in a new release.  A work-around I used was to 
>> simply put the code below in the admin default.py into comment:
>> *#if not a_for_check.startswith(web2py_apps_root):*
>> *#raise HTTP(403) *
>> But I don't know what the final solution will be in the official fix.
>>
>> Kind Regards,
>> David
>>
>> On Sunday, February 12, 2023 at 10:21:20 PM UTC+1 pcg...@gmail.com wrote:
>>
>>> Have the same issue (python 3.10)  i've tried the latest web2py 2.23.1, 
>>> and it's th same.   I'm kind of lost on this one.
>>>
>>> Le lundi 9 janvier 2023 à 05:44:16 UTC-5, david@gmail.com a écrit :
>>>
 I am using python 3.9.15

 On Monday, January 9, 2023 at 11:00:22 AM UTC+1 Clemens wrote:

> Just a guess: What python version are you using? If you're still using 
> python 2, it could be the reason.
>
> On Monday, January 9, 2023 at 10:55:21 AM UTC+1 david@gmail.com 
> wrote:
>
>> Which is in turn caused by:
>>
>> *def app_pack*(app, request, raise_ex=False, filenames=None):
>> """Builds a w2p package for the application
>>
>> Args:
>> app(str): application name
>> request: the global request object
>> Returns:
>> filename of the w2p file or None on error
>>
>> """
>> try:
>> if filenames is None:
>> app_cleanup(app, request)
>> *filename = apath('../deposit/web2py.app.%s.w2p' % app, 
>> request)*
>> w2p_pack(filename, apath(app, request), filenames=filenames)
>> return filename
>> except Exception as e:
>> if raise_ex:
>> raise
>> return False
>>
>> On Monday, January 9, 2023 at 10:37:57 AM UTC+1 Davidiam wrote:
>>
>>> I found where this is occurring (out of the box run, no mods):
>>>
>>>
>>> C:\Users\u30591\web2py_2.23.0\web2py\applications\admin\controllers\default.py:
>>> def safe_open(a, b):
>>> if (DEMO_MODE or is_gae) and ('w' in b or 'a' in b):
>>> class tmp:
>>>
>>> def write(self, data):
>>> pass
>>>
>>> def close(self):
>>> pass
>>> return tmp()
>>>
>>> a_for_check = os.path.abspath(os.path.normpath(a))
>>> web2py_apps_root = os.path.abspath(up(request.folder))
>>>
>>> *if not a_for_check.startswith(web2py_apps_root):*
>>> *raise HTTP(403) *
>>>
>>> Because:
>>> *web2py_apps_root* = 
>>> 'C:\\Users\\myuser\\web2py_2.23.0\\web2py\\applications'
>>> *a_for_check *=  
>>> 'C:\\Users\\myuser\\web2py_2.23.0\\web2py\\deposit\\web2py.app.403_test.w2p'
>>>
>>>
>>> On Thursday, January 5, 2023 at 9:54:07 AM UTC+1 Davidiam wrote:
>>>
 Good Morning,

 We are using IIS 10 with web2py 2.23.0.

 When I try to pack the welcome application (or any other), using 
 pack_all I get a 403 error.
 When I try to pack the welcome application (or any other), using 
 pack_custom, it first displays the file selector and when I click on 
 download as .w2p I get a 403 error.

 This seems to be related to the open_redirect changes.  I tried 
 putting the 403 error related code from the admin\default.py 
 controller in 
 comment, but it still is giving the error.  

 Kind Regards,
 David

>>>

-- 
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/21c3152c-0741-4f1e-8d68-60fd95d1c888n%40googlegroups.com.


[web2py] web2py 2.23.0 released

2022-12-26 Thread Massimo Di Pierro
Hello Everybody,

My apologies for not being as engaged in this group as I used to be.

web2py 2.23.0 was released.

It includes:
- DKIM support to emails
- More configuration options for 2-factor authentication
- Fixed an open redirect vulnerability
- Some bugs fixes.

Thanks everybody who contributed, especially Leonel.

As you noticed the pace of changes in web2py is very slow. Once again I 
recommend that you take a look at py4web, also based on pydal and the same 
template language and helpers as web2py. Yet it is much faster and designed 
from scratch to work with python 3.

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/84e0b47f-84bc-4b9f-9704-d2fbd96bcf0cn%40googlegroups.com.


[web2py] Re: Git cloning web2py fails. Some issues with recursive cloning of ytal and pydal

2022-06-03 Thread Massimo Di Pierro
fixed. sorry for the mistake.


On Tuesday, 31 May 2022 at 08:15:55 UTC-7 kell...@gmail.com wrote:

> [image: image.png]
>
> Am Di., 31. Mai 2022 um 17:13 Uhr schrieb Kevin Keller  >:
>
>> If you try to git clone web2py you will run into a strange error: 
>>
>> Could you have a look Massimo please?
>>
>> git clone --recursive https://github.com/web2py/web2py.git
>>
>>
>>
>>
>>
>> [image: image.png]
>>
>

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


[web2py] Re: deploy web2py with gunicorn, Nginx y HTTPS

2022-05-07 Thread Massimo Di Pierro
Gunicorn creates processes, not threads so if you have multiple CPUs is 
takes advantage of them. Threads in python do not work as well because of 
the GIL and some times make things worse.

On Sunday, 17 April 2022 at 16:29:34 UTC-7 xgp.l...@gmail.com wrote:

> Hi all,
>
> What are the advantages when using Gunicorn?
>
>
> Cheers,
>
> El domingo, 13 de septiembre de 2020 a las 17:15:40 UTC-5, 
> jpa...@gmail.com escribió:
>
>> Perfect. Gracias 
>>
>>
>> El sábado, 12 de septiembre de 2020 a las 17:10:10 UTC+2, cabildocl 
>> escribió:
>>
>>> I wrote an article in Spanish on how to deploy web2py with https
>>>
>>>
>>> http://cabildocl.blogspot.com/2020/09/implementar-web2py-con-gunicorn-nginx-y.html
>>>
>>>
>>>

-- 
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/8c9b83d6-9967-467d-8dad-cc1a6078c4d5n%40googlegroups.com.


[web2py] Re: Pillow not imported by web2py-win

2022-05-07 Thread Massimo Di Pierro
can you try "pip install pillow" instead of putting it in 
C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages 
Not all packages like to be there and it can create problems.


On Wednesday, 20 April 2022 at 00:26:48 UTC-7 snide...@gmail.com wrote:

> I want to do some simple image manipulation using Pillow.  I've been using 
> Pillow in a standalone Python27 setup, and now I want to use it within my 
> w2p app.
>
> Since I had done the PIP into the standalone, I copied the files from that 
> site-packages to the web2py/site-packages.  The function that needed to use 
> the package did 
>
> from PIL import Image
>
> which resulted in the stacktrace:
>
> Traceback (most recent call last):
> File 
> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\restricted.py", 
> line 219, in restricted
> exec(ccode, environment)
> File 
> "C:/Users/Dave/web2py_win/web2py_win_2.21.1_py27/web2py/applications/badlist/controllers/default.py"
>  
> , line 
> 2691, in 
> File 
> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\globals.py", 
> line 430, in 
> self._caller = lambda f: f()
> File 
> "C:/Users/Dave/web2py_win/web2py_win_2.21.1_py27/web2py/applications/badlist/controllers/default.py"
>  
> , line 
> 1059, in display
> img = Image.open(deep_path)
> File 
> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages\PIL\Image.py",
>  
> line 2807, in open
> if init():
> File 
> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages\PIL\Image.py",
>  
> line 427, in init
> __import__("PIL.%s" % plugin, globals(), locals(), [])
> File 
> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\custom_import.py",
>  
> line 59, in custom_importer
> return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
> File 
> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages\PIL\EpsImagePlugin.py",
>  
> line 51, in 
> which = distutils.spawn.find_executable
> AttributeError: 'module' object has no attribute 'spawn'
>
> What are my options here, and what is the simplest way to get past this?  
> Should I
>
> * try to get the appropriate distutils?
> * try to run web2py from source on the standalone 2.7?
> * try to run web2py-win's 3.x and switch to the matching Pillow?
>
> (I think I have a standalone 3.10 already, but I haven't run Pillow on 
> that)
>
> Thanks for the sage advice.
>
> /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/b35e69b6-9151-43d3-895a-faf05c03607fn%40googlegroups.com.


[web2py] Re: wev2py 2.22.1 is out

2022-02-13 Thread Massimo Di Pierro
I am very confused by this. I cannot find any change that could cause this 
change of behavior. Let me summarize to make sure I am understanding.

You observed a change of behavior between 2.21.1 and 2.22 1.
The change of behavior only manifests when you declare a default app in 
routers.py
The change of behavior consists of the fact that, if you upload a file 
using a form, the link to download the file does not work.
You can confirm that the file is there and the link works if no default app 
in routers is provided.

Is this all correct? If yes. I will debug more. If you could provide a 
minimalist app to reproduce it would save me some time.

Massimo



On Wednesday, 9 February 2022 at 07:21:40 UTC-8 cdbaron wrote:

> Now from github I can successfully download web2py.
>
> But I have a problem with a form with a field of type upload.
>
> With web2py 2.21.1 it works fine, but with version 2.22.1 it doesn't work. 
> I have tested with python 3.7 and 3.8
>
> I already posted a query a few days ago, but I haven't had any response, I 
> apologize for posting the same thing again.
>
> When I upload any image with a form, for example the one below, when 
> downloading the image I get a 400 bad request error
>
> def upload_img():
> record = db(db.t_upload).select().first()
> form = SQLFORM(
> db.t_upload,
> record,
> upload=URL('default', 'download')
> )
>
>
> I think it is some modification in web2py after publishing version 2.21.1
>
> I have tried to attach a .w2p file with the myapp application but it does 
> not allow me to upload this type of file.
>
> The application works perfectly if I do NOT use a routes.py file in the 
> web2py root directory.
>
> http://127.0.0.1:8000/myapp/upload/upload_img (Works fine)
>
> But with the file routers.py with this content:
>
> routers = dict(
> BASE=dict(
> default_application='myapp',
> ),
> )
>
> The application does not work well, there is a 400 error when downloading 
> the
> image uploaded with the form
>
> http://127.0.0.1:8000/upload/upload_img (Doesn't work right)
>
> This 400 error also occurs whenever the image is used, not just on the 
> form.
>
> I am doing something wrong?

-- 
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/0aa0159d-2403-490b-8d40-f14f495e650cn%40googlegroups.com.


[web2py] Re: wev2py 2.22.1 is out

2022-02-13 Thread Massimo Di Pierro
I rerun the build script. Can you please confirm it is fixed for you?

On Saturday, 12 February 2022 at 12:02:48 UTC-8 perakoj...@gmail.com wrote:

> Hi Massimo, 
>
> As already pointed out, when I try to download source code from this 
> addres https://mdipierro.pythonanywhere.com/examples/static/web2py_src.zip 
> the dal directory is empty and it breaks web2py. 
>
> On Tuesday, February 1, 2022 at 4:59:33 AM UTC+1 Massimo Di Pierro wrote:
>
>> Hello Everybody,
>>
>> web2py 2.22.1 is out.
>>
>> Includes a few bug fixes and some changes including:
>> - support for mail.sent(reply_to=...), thanks Ofa
>> - fix a bug to enable redis with python3, thanks Leonel
>> - upgraded to latest pydal and yatl
>>
>> Please report any breakages or issues.
>>
>> 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/e6c418a6-e44d-4a96-b8fe-257e109a88dfn%40googlegroups.com.


[web2py] wev2py 2.22.1 is out

2022-01-31 Thread Massimo Di Pierro
Hello Everybody,

web2py 2.22.1 is out.

Includes a few bug fixes and some changes including:
- support for mail.sent(reply_to=...), thanks Ofa
- fix a bug to enable redis with python3, thanks Leonel
- upgraded to latest pydal and yatl

Please report any breakages or issues.

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/89208035-97c3-4c0f-9b6c-754ea254b2f4n%40googlegroups.com.


[web2py] Re: web2py.com down

2022-01-31 Thread Massimo Di Pierro
Indeed it was down. Somehow a file was corrupted. It is fixed now and 
upgraded to the latest version.

On Monday, 31 January 2022 at 17:10:35 UTC-8 snide...@gmail.com wrote:

> On Monday, January 31, 2022 at 1:03:28 PM UTC-8 Vlad wrote:
>
>> Indeed. 
>>
>> On Sunday, January 30, 2022 at 10:20:06 PM UTC-6 Raul Monares wrote:
>>
>>> The site is down :(
>>
>>
> Continuing:
>
> GET 
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer 
> 500 (Internal Server Error)
> favicon.ico:1 GET http://web2py.com/favicon.ico 500 (Internal Server 
> Error)
>
> /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/a27cf4b4-b297-4df7-a4ba-3b112adcb4f1n%40googlegroups.com.


[web2py] Re: belongs DAL syntax to search word contains in list:reference type Field

2021-10-10 Thread Massimo Di Pierro
this should work:

nested_select = 
db(db.address.address.contains('boulevard'))._select(db.address.id)
rows = db(db.customer.address.belongs(nested_select) ).select()

Notice the _select instead of select makes it a nested select.
Without _ it would give the same result with two explicit selects.

On Sunday, 10 October 2021 at 03:15:32 UTC-7 黄祥 wrote:

> *table*
> db.define_table('address',
> Field('address'),
> format = lambda r: f'{r.address}' )
>
> db.define_table('customer',
> Field('name'),
> Field('address', 'list:reference address'),
> format = lambda r: f'{r.name}' )
>
> *objective*
> search customer address by type the words that contains address e.g. 
> 'boulevard'
>
> *already tried*
> db(db.customer.address.belongs(db.address.address.contains('boulevard') ) 
> ).select()
>
> no error occured but the result is not expected (blank)
>
> any idea to achieve it ?
> thanks
>

-- 
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/544e6188-a4d8-42eb-811c-6965cdea6ff6n%40googlegroups.com.


[web2py] Re: sqlhtml changes for sqlform.factory, not nice, 2.15.4 versus 2.18.5

2021-10-09 Thread Massimo Di Pierro
Looking at latest version 2.21. The change you mention is only for create 
forms, not edit forms. It basically say if a field is readable and not 
writable and has not value, it should not be displayed. It seems the 
correct behavior to me. Maybe in 1.18 the same logic was incorrectly 
applied to edit fors as well? Do not remember. Please try the latest.



On Saturday, 9 October 2021 at 14:14:17 UTC-7 Awe wrote:

> Thanks for the answer 
> I haven't tried the latest version and I hope this behavior doesn't change 
> from version to version..
> but. I thought / hoped a web2py developer could explain why this 
> important/central feature was changed and how to deal with it best.
> Jim S schrieb am Samstag, 2. Oktober 2021 um 16:26:42 UTC+2:
>
>> Have you tried with the latest web2py?
>>
>> I'm assuming the behavior is the same as with 2.18.5. 
>>
>> Have you been able to pinpoint a commit that would have changed this 
>> behavior?
>>
>> -Jim
>>
>> On Thursday, September 30, 2021 at 4:04:28 AM UTC-5 Awe wrote:
>>
>>> Is anybody out there facing the same problem, wondering about getting no 
>>> answers...
>>>
>>> Awe schrieb am Mittwoch, 4. August 2021 um 18:16:40 UTC+2:
>>>
 we are using sqlform.factory a lot, but the way fields are shown/behave 
 was changed from
 2.15.4
 fields = [f.name for f in table if  (ignore_rw or f.writable or 
 f.readable) 
 and (readonly or not f.compute)]
 to
 2.18.5
 fields = [f.name for f in table if (ignore_rw or f.writable or 
 (f.readable and f.default)) and not f.compute]

 so in 2.15.4 it was no problem to have an edit form with fields like
 readable=True, writable=False, default=""
 this field having an empty string was shown disabled, great as expected.

 in 2.18.5
 this field will not be shown anymore, we need to set default=" " like 
 this, which is
 not very useful.

 Is this a bug or feature, or is there a NEW common way to have empty 
 readonly fields in an
 edit form

 Many thanks for any help!

>>>

-- 
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/5a36f80e-144a-47d5-99a7-ad78a549105fn%40googlegroups.com.


[web2py] Re: this not runs . Field('materials', 'list:string','reference malzemeler')

2021-10-05 Thread Massimo Di Pierro
Hello Cassio,

the Field constructor takes a name and a type. The type can be 
"list:reference malzemeler" (assuming you have a table malzemler). Also if 
you want the value to display something other than the id of a referenced 
record, you have to specify a record format for the referenced table. In 
your case for example db.define_table("malzemler", Field("name"), 
format="%(name)s").

If you want dropdowns in multi-lists you may want to consider using 
requires=IS_IN_DB(db, table.id, table.namefield, multiple=True) and use 
something like 
http://www.web2pyslices.com/slice/show/1395/jquery-multi-select-widget

Notice that all of this is very old. If you need a complex interface I 
would highly recommend using Vue.js and create your own UI and use py4web 
for backend api. That will work much better and be more customizable.

Massimo




On Tuesday, 5 October 2021 at 06:49:20 UTC-7 cassio...@gmail.com wrote:

> hi everyone,
>
>  i have encountred a problem.
>
> as you see a field below, I want to add more rows to materials and I want 
> to add a dropdown box to each added row.
>
>  
>
> *Field('materials', 'list:string','reference malzemeler'),*
>
>
> these codes not run. Also I am using  SQLFORM.grid.
>
> i want to add rows (using + and - buttons). 'list:string' make this.
>
> also , i want to add drop down box  to these rows. 
>
> could you help please.
>

-- 
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/96231c5f-0899-4e7c-9dd7-3a08e48f060cn%40googlegroups.com.


[web2py] Re: Guidelines for choosing web2py or py4web

2021-10-05 Thread Massimo Di Pierro
I started both projects so I have an opinion on this topic. :-)

Use py4web.

web2py started in 2007 and it is now 14 years old. We learned a lot from it 
and py4web was thought of a successor.

py4web and web2py share:
- the same DAL
- the same validators
- the same template language (but a faster implementation)
- the same default multi-threaded web server (rocket3) but both work with 
any.
- almost equivalent helpers DIV, SPAN, etc (but simpler, faster, less 
gotcha, must be imported)
- similar web based IDE
- similar internationalization system (T) but better pluralization 
capabilities
- similar SQLFORM/Grid API called Form/Grid but more customizable and 
faster.
- both can run multiple apps behind one framework instance.

py4web is better than web2py because:
- it is at least 10x faster
- it is designed for Python 3
- you can "pip install py4web" and that is all you need to do
- no gotchas when using third party libraries
- it does not eval code at every request but uses normal python modules 
(every app is a module)
- it uses a routing syntax similar to bottle/flask
- it has an extensible Auth mechanism.
- it has better documentation (uses read-the-docs/sphinx)
- it has a much smaller code base and it is more modular

py4web lacks (when comparing to web2py):
- @auth.requires_login() decorators because we use a different mechanism 
@action.uses(auth.user)
- auth groups and permission because we handle groups and permissions with 
DAL Tags on users.
- CAS (because we have not finished implementing it) but we have better 
Oauth2 support, including Google, Facebook, and Ockta.

Gotchas:
- there is not request.args and request is the bottlepy/ombott Request 
object.
- auth.user is now called auth.current_user (auth.user is a Fixture) and 
this confuses people a bit.
- the web IDE and appadmin equivalent logic is more spartan and we are 
still improving it.

web2py is very stable has has not been touched in months.
py4web is still evolving we make commits almost every day.
I have ported my old apps to py4web without too much trouble.

Massimo

Example of py4web app:

from py4web import DAL, Field, action
from py4web.utils.form import Form

db = DAL("sqlite::storage.db")
db.define_table("thing", Field("name"))

@action("thing", method=["GET", "POST"])   # create form with postbacks
@action("thing/", method["GET", "POST"])  # edit form with postbacks
@action.uses(db, "index_template.html")  # specify the template file
def thing(id=None):
   form = Form(db.thing, id)   # same as SQLFORM(db.thing, 
request.args(0)).process()
   return dict(form=form)



On Tuesday, 5 October 2021 at 11:50:19 UTC-7 Jim S wrote:

> I am biased, but do yourself a favor and write it with py4web.
>
> The execution isn't just a little bit faster, it is orders of magnitude 
> faster.
>
> Check out the SouthBreeze sample app I wrote using py4web, bulma and 
> htmx.  https://southbreeze.pythonbench.com
>
> Documentation for web2py is better, but a lot of it translates to py4web.
>
> Are you an experienced web2py developer?  If so, check out the py4web docs 
> on web2py and py4web differences -> 
> https://py4web.com/_documentation/static/en/chapter-15.html
>
> Major update to the py4web git repo yesterday that takes replaces Bottle 
> in py4web with ombott written by ValK.  
>
> Another recent change with significant performance improvement is the move 
> from yatl to renoir for template rendering. No syntax changes, just LOTS 
> faster.
>
> Using htmx for reactivity in the front end is significantly easier than 
> using JS libraries/frameworks for front-end development (again, my 
> opinion).  https://htmx.org
>
> Ok, I'll shut up now
>
> We're here to help with py4web questions on the google group or the 
> discord channel https://discord.gg/xCzQ9KTk3W
>
> -Jim
>
> On Tuesday, October 5, 2021 at 8:50:49 AM UTC-5 brucutu...@gmail.com 
> wrote:
>
>> Today I've discovered that web2py has a child called py4web. Now I'm 
>> confused about when to choose any one of these.
>>
>> Documentation says py4web is faster than web2py, but it seemed to me 
>> py4web is also more difficult to work with (although I can see that's for a 
>> justifiable reason).
>>
>> So, does anyone has some guidelines for choosing between them?
>>
>> Note: I'm devising an ERP system using web2py (or maybe py4web now) for 
>> the backend, webix (pure JS library -- not framework -- for the frontend) 
>> and postgresql. I'm also thinking about using meta-modeling for this whole 
>> project.
>>
>

-- 
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: Web2py site ssl expired

2021-10-03 Thread Massimo Di Pierro
Thanks for reminding me about this. I will renew it asap.

On Wednesday, 22 September 2021 at 00:06:06 UTC-7 snide...@gmail.com wrote:

> On Wednesday, September 15, 2021 at 2:39:19 AM UTC-7 dirman wrote:
>
>>
>> Well same from my end. SSL expired
>> On Saturday, September 11, 2021 at 2:04:38 PM UTC+1 rodrig...@gmail.com 
>> wrote:
>>
>>> Hello my friends, I don't know for report this.
>>> https://web2py.com/ when I access this url.
>>> This not show with http.
>>>
>>
> http probably doesn't check certificates.
>
> However, what Opera says I'm seeing with http*s* now is 
> NET::ERR_CERT_COMMON_NAME_INVALID
>
> /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/2d7e61d3-da80-426b-8142-3d7f82fba1dcn%40googlegroups.com.


[web2py] Happy New Year

2020-12-31 Thread Massimo Di Pierro

I wish you all a happy new year.

-- 
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/549315bc-94d2-437f-b121-1b7ef88ddbddn%40googlegroups.com.


[web2py] Re: 2to3

2020-12-31 Thread Massimo Di Pierro
you can use json-rpc2 with py4web but it is not built-into the framework. 
It does not need to be. I will post an example.

py4web has jwt auth support although the syntax is a different.

py4web is not as mature as web2py but very mature. The pros are the speed, 
the cleaner/leaner implementation and works better with third party 
modules. At this time more development is going into py4web than into 
web2py.

I think web2py remains the only choice for python2. If you are moving to 
python3 than you have a choice.
On Friday, 25 December 2020 at 04:10:30 UTC-8 vinid...@gmail.com wrote:

> What are the benefits of porting to py4web?
>
> I use json-rpc2 extensively in my web2py app.
>
> Does py4web support json-rpc2 (or other rpc services) out of the box the 
> way web2py does?
>
> Does it support jwt authentication the way web2py does?
>
> Is py4web stable and mature enough to consider switching?
>
> On Monday, December 14, 2020 at 9:52:49 PM UTC+7 villas wrote:
>
>> The framework is compatible with both.  
>> However, your own code may only be compatible with one or the other - 
>> that's up to you.
>> Once you get to know what the differences are, you can scan the code 
>> pretty easily yourself.  Still, the 2to3 is helpful if you have lots of 
>> code.
>> One simplistic approach is simply to make a copy of your app,  try it 
>> under python 3, and fix what is broken.
>> Important:  anyone making such a conversion is being increasingly 
>> encouraged to also consider porting it to py4web.  This is a steeper 
>> learning curve,  but it may be a better long term solution.
>>
>> On Saturday, 12 December 2020 at 17:37:44 UTC Tele Tom wrote:
>>
>>> I'm looking to run 2to3 to upgrade my python code.  How do I get it?  Is 
>>> it easy to do?  Is it worth it?
>>>
>>> Can I run my web2py 2.21.1 with python 2.7 or must I use python 3?
>>>
>>> thanks
>>> Davey
>>>
>>

-- 
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/8a049c07-63a3-4cef-95a0-af5ec62d0ca4n%40googlegroups.com.


[web2py] Re: web2py 2.21.1 is OUT

2020-12-05 Thread Massimo Di Pierro
Will look into this asap.

On Monday, 30 November 2020 at 00:34:48 UTC-8 jpa...@gmail.com wrote:

> Hello, 
>
> I think it is an issue that comes from previous version. It has to do with 
> IS_NOT_IN_DB validator and auth. It worked in 2.17.2 version with no problem
>
> Traceback (most recent call last): 
>  File 
> "/base/data/home/apps/e~canal-responsable-marcafranca/218.431301544681755891/gluon/restricted.py",
>  
> line 219, in restricted exec(ccode, environment) 
>  File 
> "/base/data/home/apps/e~canal-responsable-marcafranca/218.431301544681755891/applications/myapp/controllers/mycontroller.py",
>  
> line 199, in  
>  File 
> "/base/data/home/apps/e~canal-responsable-marcafranca/218.431301544681755891/gluon/globals.py",
>  
> line 430, in  self._caller = lambda f: f() 
>  File 
> "/base/data/home/apps/e~canal-responsable-marcafranca/218.431301544681755891/gluon/tools.py",
>  
> line 3875, in f return action(*a, **b) 
>  File 
> "/base/data/home/apps/e~canal-responsable-marcafranca/218.431301544681755891/applications/myapp/controllers/mycrontroller.py",
>  
> line 110, in crear_usuario if form.accepts(request.vars, session): 
>  File 
> "/base/data/home/apps/e~canal-responsable-marcafranca/218.431301544681755891/gluon/sqlhtml.py",
>  
> line 1790, in accepts **kwargs 
>  File 
> "/base/data/home/apps/e~canal-responsable-marcafranca/218.431301544681755891/gluon/html.py",
>  
> line 2162, in accepts status = self._traverse(status, hideerror) 
>  File 
> "/base/data/home/apps/e~canal-responsable-marcafranca/218.431301544681755891/gluon/html.py",
>  
> line 921, in _traverse newstatus = c._traverse(status, hideerror) and 
> newstatus 
>   File 
> "/base/data/home/apps/e~canal-responsable-marcafranca/218.431301544681755891/gluon/html.py",
>  
> line 921, in _traverse newstatus = c._traverse(status, hideerror) and 
> newstatus 
>  File 
> "/base/data/home/apps/e~canal-responsable-marcafranca/218.431301544681755891/gluon/html.py",
>  
> line 921, in _traverse newstatus = c._traverse(status, hideerror) and 
> newstatus 
>  File 
> "/base/data/home/apps/e~canal-responsable-marcafranca/218.431301544681755891/gluon/html.py",
>  
> line 921, in _traverse newstatus = c._traverse(status, hideerror) and 
> newstatus 
>  File 
> "/base/data/home/apps/e~canal-responsable-marcafranca/218.431301544681755891/gluon/html.py",
>  
> line 928, in _traverse newstatus = self._validate() 
>  File 
> "/base/data/home/apps/e~canal-responsable-marcafranca/218.431301544681755891/gluon/html.py",
>  
> line 1908, in _validate raise Exception(msg) 
> Exception: Validation error, field:email  object at 0x3ebef34de910>
>
> This is the code of the controller where it breaks
>
>
> form = SQLFORM(db.auth_user)
> if form.accepts(request.vars, session):
>
> It also fails in appadmin db.auth_user new record
>
>
> El sábado, 28 de noviembre de 2020 a las 5:22:19 UTC+1, Massimo Di Pierro 
> escribió:
>
>>
>> Hello everybody, 
>>
>> first of all my apologies to you all. I have been absent from this list 
>> for some time, mostly because busy with py4web.
>>
>> I made a new release (2.21.1) of web2py which includes mostly small bug 
>> fixes but no new features. Please report any problem.
>>
>> At this point web2py has been stable for long time so we are not planning 
>> to add features.
>>
>> py4web on the other side is growing fast. It now has Auth, 
>> internationalization, Form, Grid and it is 20x faster than wb2py. pyDAL 
>> woks the in the same way as in web2py. I insist you should check it out and 
>> consider moving you code. It is easy and we will help.
>>
>> 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/a6641acd-99b1-4a17-9183-c2961f58eb3an%40googlegroups.com.


Re: [web2py] web2py 2.21.1 is OUT

2020-12-05 Thread Massimo Di Pierro
Hello Felix,

This is the only video I made 
https://www.youtube.com/watch?v=hcYUgNWvPtw=68s
But the app in the video ships with py4web.

Massimo

On Monday, 30 November 2020 at 07:19:19 UTC-8 felix jimenez wrote:

> Hello Massimo, 
>
> could you please post  a new video full practical example 
> with py4web, thanks
>
> [image: image.png]
>
>
> El sáb, 28 nov 2020 a las 0:22, Massimo Di Pierro () 
> escribió:
>
>>
>> Hello everybody, 
>>
>> first of all my apologies to you all. I have been absent from this list 
>> for some time, mostly because busy with py4web.
>>
>> I made a new release (2.21.1) of web2py which includes mostly small bug 
>> fixes but no new features. Please report any problem.
>>
>> At this point web2py has been stable for long time so we are not planning 
>> to add features.
>>
>> py4web on the other side is growing fast. It now has Auth, 
>> internationalization, Form, Grid and it is 20x faster than wb2py. pyDAL 
>> woks the in the same way as in web2py. I insist you should check it out and 
>> consider moving you code. It is easy and we will help.
>>
>> 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+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/3db686af-90dc-4864-891a-fe7050cf40c7n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/3db686af-90dc-4864-891a-fe7050cf40c7n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
>
> -- 
> fvj...@hotmail.com
> 04166293294
> 04141160952
>

-- 
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/2c67e01f-3401-40aa-9c55-2ca0271ee2d1n%40googlegroups.com.


[web2py] py4web new docs

2020-11-27 Thread Massimo Di Pierro

https://py4web.com/_documentation/static/en/index.html

-- 
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/ac20d92a-252e-4394-8116-0aff1a87201fn%40googlegroups.com.


[web2py] web2py 2.21.1 is OUT

2020-11-27 Thread Massimo Di Pierro

Hello everybody, 

first of all my apologies to you all. I have been absent from this list for 
some time, mostly because busy with py4web.

I made a new release (2.21.1) of web2py which includes mostly small bug 
fixes but no new features. Please report any problem.

At this point web2py has been stable for long time so we are not planning 
to add features.

py4web on the other side is growing fast. It now has Auth, 
internationalization, Form, Grid and it is 20x faster than wb2py. pyDAL 
woks the in the same way as in web2py. I insist you should check it out and 
consider moving you code. It is easy and we will help.

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/3db686af-90dc-4864-891a-fe7050cf40c7n%40googlegroups.com.


[web2py] Re: pyDAL looks abandoned?

2020-08-17 Thread Massimo Di Pierro
yes Peewee is more actcie but I would not say pydal is abandoned. pydal is 
more mature and there were commits as recent as last week. In my opinion it 
needs very little work and I am reluctant to change things. Many of the 
issues are requests for new features, some are how to, or support for 
exhotic features. There are also many issue that have been fixed but the 
issue has not been closed. When I have time I will take a pass and close a 
bunch.

I do not think there are many bugs in pydal that need fixing excecpt for 
the need to support google cloud storage in py3.


On Monday, 11 May 2020 13:27:14 UTC-7, Val K wrote:
>
>
> There are 131 issues on pyDAL-GitHub, but the problem is not in the amount 
> but in that more than half of them without any response. Look at peewee 
> that has 7.5k stars and only 2 open issues!... yes, this is impolite 
> comparision - sorry.
> I've just need to implement CTE + WITH RECURSIVE (like this 
> http://docs.peewee-orm.com/en/latest/peewee/querying.html#recursive-ctes) 
> and I wasted 2 days to figure out how I can do very simple thing like  '1 
> AS foo'  in right way that is (as I suppose):
> Expression(db, '1', type='integer').with_alias('foo')
>
> So, the question is: why is there nothing about that in the book?
> Why does pyDAL have no that very simple but very necessary method  which 
> allows to do cool things like:
>  db(...).select(
> ...,
> db.exp(
>'max(product.price) OVER(PARTITION BY product.category)', 
>type = 'decimal(n, m)' # the same as Field(..., type = 'decimal(n, 
> m)')
> ).with_alias('most_expensive_in_category')
> )
>
> here is used WINDOW-function that allows to get products list with 
> 'most_expensive_in_category' in *one* plain query 
> *without using subquery* with GRUOP BY product.category + join
>
> Also there is my PR on web2py book 
> https://github.com/web2py/web2py-book/pull/424
> it hangs for almost a year - it is just a book, not code
> I'm sad
>

-- 
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/8a858190-e078-44f8-bcff-c88c13dae0b6o%40googlegroups.com.


[web2py] Re: Sending smses via my web2py

2020-08-05 Thread Massimo Di Pierro
Nice. will integrate with py4web. :-)


On Wednesday, 5 August 2020 16:01:18 UTC-7, Jacinto Parga wrote:
>
> I use https://www.messagebird.com/
> It has a well documented api and works well with web2py
> El miércoles, 5 de agosto de 2020 a las 20:58:51 UTC+2, Massimo Di Pierro 
> escribió:
>
>> That list of service providers is very old. I sugget you use twilio
>>
>>
>> On Wednesday, 5 August 2020 02:14:11 UTC-7, mostwanted wrote:
>>>
>>>
>>> I am failing to send smses with my app following the book example (
>>> http://www.web2py.com/books/default/chapter/29/08/emails-and-sms#Emails-and-SMS)
>>>  
>>> which i felt was straight forward, is there something extra must include in 
>>> my controller code?
>>>
>>> *MY CODE*
>>> def send_sms():
>>> from gluon.contrib.sms_utils import SMSCODES, sms_email
>>> email = sms_email('+000 (00) 000-000','Orange')
>>> mail.send(to=email, subject='sms test', message='testing testing 
>>> 123')
>>>
>>> Regards
>>>
>>> Mostwanted
>>>
>>

-- 
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/5c8f8e5c-9096-4194-aba0-785c8bf07b12o%40googlegroups.com.


Re: [web2py] Re: WAF2PY 1.0

2020-08-05 Thread Massimo Di Pierro
py4web apps are not required to use vue. The auth page currently uses vue 
and some of the examples do but we are rolling out a new version of Auth 
that does not.  

On Wednesday, 5 August 2020 12:32:33 UTC-7, Christian Varas wrote:
>
> I will port it to py4web :), is the next step.
>
> I have a custom py4web app (non vuejs) managing sensors and gpio (relés) 
> in a raspberry pi, so I am already familiar with it :). Py4web is so fast 
> and good!
>
> Cheers.
> Chris,
>
> El mié., 5 ago. 2020 a las 13:12, Massimo Di Pierro (<
> massimo.dipie...@gmail.com>) escribió:
>
>> Fantastic! we need to port this to py4web. ;-)
>>
>>
>> On Monday, 3 August 2020 15:53:22 UTC-7, Christian Varas wrote:
>>>
>>> Thank you.
>>>
>>> I just tested on Debian 10, but it should work for any other OS as long 
>>> the dependencies are met.
>>> The line “apt-get install **dependencies**” I’m the installation file 
>>> needs to adjusted for a non Debian based system.
>>>
>>> Cheers.
>>> Chris.
>>>
>>>
>>> El El lun, 3 de ago. de 2020 a la(s) 18:28, mostwanted <
>>> godirao...@gmail.com> escribió:
>>>
>>>> Complements Chris, this is really impressive work. I see you have 
>>>> tested on debian is it platform specific or will it run on any OS?
>>>>
>>>> On Monday, August 3, 2020 at 8:25:23 AM UTC+2, Christian Varas wrote:
>>>>>
>>>>> Hello all. 
>>>>> I'm glad to announce  WAF2PY 1.0 
>>>>>
>>>>> *What is this?*
>>>>>
>>>>> WAF2PY is a Web Application Firewall using NGINX and ModSecurity. 
>>>>> WAF2PY provides a nice and easy to use web interface *powered by* 
>>>>> *WEB2PY* that controls modsecurity and nginx configuration in an easy 
>>>>> way, allowing you to configure protection for any web application in just 
>>>>> minutes.
>>>>>
>>>>>
>>>>>
>>>>> *Features*
>>>>>
>>>>>- Protect a site in just minutes
>>>>>- Create global or local exclusions for any rule
>>>>>- Add virtual interfaces
>>>>>- Create static routes for the desired app
>>>>>- Analyze debug, access, error and audit logs
>>>>>- Download logs
>>>>>- Check the stats for every application
>>>>>- Disable/Enable protection with just 1 click
>>>>>- Enable/Disable rules
>>>>>- Modify rules
>>>>>- Restrict paths or files
>>>>>- Insert headers
>>>>>- Start/Stop/Reload/Check Syntax of NGINX
>>>>>- CAPTCHA on login (Google Recaptcha2)
>>>>>- Two-step Login Authentication (Email code)
>>>>>- Written on Python3
>>>>>
>>>>>
>>>>> *Images*
>>>>>
>>>>> https://photos.app.goo.gl/kXrsQTPPMuAXi8Tr5
>>>>>
>>>>> *Download*
>>>>>
>>>>> You can download WAF2PY from github:
>>>>>  https://github.com/ITSec-Chile/Waf2Py 
>>>>> <https://github.com/ITSec-Chile/Waf2Py>
>>>>>
>>>>> *About this bundle*
>>>>>
>>>>> Tested in Debian 10 (No docker).
>>>>>
>>>>> *Components for this build:*
>>>>>
>>>>>- Waf2Py 1.0 App
>>>>>- Web2Py 2.20.2
>>>>>- Nginx version: openresty 1.17.6.2
>>>>>- ModSecurity v3 - libmodsecurity3
>>>>>- Modsecurity Nginx connector OWASP ModSecurity Core Rule Set 
>>>>>(CRS) 3.3
>>>>>
>>>>>
>>>>>
>>>>> I know this can be off topic in this list, but web2py users may want 
>>>>> to have a look at it :)
>>>>>
>>>>>  
>>>>> Cheers.
>>>>> Chris.
>>>>>
>>>> -- 
>>>> 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 recei

[web2py] Re: Sending smses via my web2py

2020-08-05 Thread Massimo Di Pierro
That list of service providers is very old. I sugget you use twilio

On Wednesday, 5 August 2020 02:14:11 UTC-7, mostwanted wrote:
>
>
> I am failing to send smses with my app following the book example (
> http://www.web2py.com/books/default/chapter/29/08/emails-and-sms#Emails-and-SMS)
>  
> which i felt was straight forward, is there something extra must include in 
> my controller code?
>
> *MY CODE*
> def send_sms():
> from gluon.contrib.sms_utils import SMSCODES, sms_email
> email = sms_email('+000 (00) 000-000','Orange')
> mail.send(to=email, subject='sms test', message='testing testing 123')
>
> Regards
>
> Mostwanted
>

-- 
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/24c96420-fb2e-4264-a975-32d289ce8ca6o%40googlegroups.com.


[web2py] Important about py4web

2020-08-05 Thread Massimo Di Pierro
There has been a lot of progress in py4web. 

Aside for the fact that it is faster and leaner than web2py it has the 
following features:
- simple pip install
- uses same pydal syntax as web2py
- uses same templates as web2py
- has Form, Grid, Auth, Flash, T, Cache, Dashboard & Tickets (need more 
work but all usable)
- out of the box support for SSO/OAuth2 including Google and Okta.

The pace of development of py4wb is much higher than web2py at this time.
We will continue maintain both and there is a fair amount of overlap.
Maybe some of the new py4web features can also be backported to web2py.

There are only 126 members in the google group, compared to 7900 here. You 
do not want to miss the boat.

https://groups.google.com/forum/#!forum/py4web

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/6ece66e3-7f62-4112-8238-4e1f7072b453o%40googlegroups.com.


Re: [web2py] Re: WAF2PY 1.0

2020-08-05 Thread Massimo Di Pierro
Fantastic! we need to port this to py4web. ;-)


On Monday, 3 August 2020 15:53:22 UTC-7, Christian Varas wrote:
>
> Thank you.
>
> I just tested on Debian 10, but it should work for any other OS as long 
> the dependencies are met.
> The line “apt-get install **dependencies**” I’m the installation file 
> needs to adjusted for a non Debian based system.
>
> Cheers.
> Chris.
>
>
> El El lun, 3 de ago. de 2020 a la(s) 18:28, mostwanted <
> godirao...@gmail.com> escribió:
>
>> Complements Chris, this is really impressive work. I see you have tested 
>> on debian is it platform specific or will it run on any OS?
>>
>> On Monday, August 3, 2020 at 8:25:23 AM UTC+2, Christian Varas wrote:
>>>
>>> Hello all. 
>>> I'm glad to announce  WAF2PY 1.0 
>>>
>>> *What is this?*
>>>
>>> WAF2PY is a Web Application Firewall using NGINX and ModSecurity. WAF2PY 
>>> provides a nice and easy to use web interface *powered by* *WEB2PY* that 
>>> controls modsecurity and nginx configuration in an easy way, allowing you 
>>> to configure protection for any web application in just minutes.
>>>
>>>
>>>
>>> *Features*
>>>
>>>- Protect a site in just minutes
>>>- Create global or local exclusions for any rule
>>>- Add virtual interfaces
>>>- Create static routes for the desired app
>>>- Analyze debug, access, error and audit logs
>>>- Download logs
>>>- Check the stats for every application
>>>- Disable/Enable protection with just 1 click
>>>- Enable/Disable rules
>>>- Modify rules
>>>- Restrict paths or files
>>>- Insert headers
>>>- Start/Stop/Reload/Check Syntax of NGINX
>>>- CAPTCHA on login (Google Recaptcha2)
>>>- Two-step Login Authentication (Email code)
>>>- Written on Python3
>>>
>>>
>>> *Images*
>>>
>>> https://photos.app.goo.gl/kXrsQTPPMuAXi8Tr5
>>>
>>> *Download*
>>>
>>> You can download WAF2PY from github:
>>>  https://github.com/ITSec-Chile/Waf2Py 
>>> 
>>>
>>> *About this bundle*
>>>
>>> Tested in Debian 10 (No docker).
>>>
>>> *Components for this build:*
>>>
>>>- Waf2Py 1.0 App
>>>- Web2Py 2.20.2
>>>- Nginx version: openresty 1.17.6.2
>>>- ModSecurity v3 - libmodsecurity3
>>>- Modsecurity Nginx connector OWASP ModSecurity Core Rule Set (CRS) 
>>>3.3
>>>
>>>
>>>
>>> I know this can be off topic in this list, but web2py users may want to 
>>> have a look at it :)
>>>
>>>  
>>> Cheers.
>>> Chris.
>>>
>> -- 
>> 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/f7e4baa1-487f-4793-9d31-2c675609e893o%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/7308fb83-3cca-45aa-9181-7d522aac7d85o%40googlegroups.com.


[web2py] py4web grid

2020-07-13 Thread Massimo Di Pierro
For some people, the lack of a server side form/grid in py4web has been 
problem and reason not to move.
We now have a prototype:

https://github.com/web2py/py4web/issues/228

Could use some help testing and feedback.

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/a57c2b2f-a8c2-4745-8335-86f0e4901d95o%40googlegroups.com.


[web2py] Re: hi i want to send steam content from webcame to view

2020-07-08 Thread Massimo Di Pierro
Here https://github.com/mdipierro/videomonitor

On Wednesday, 8 July 2020 15:22:34 UTC-7, Waleed Truman wrote:
>
> how can pass steam from video to view 
>
>
> in flask can 
>
> )Response(frame, mimetype='multipart/x-mixed-replace; boundary=frame')
>
> please help me
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/395ef901-cceb-47dc-9ebb-a9f4a260a72bo%40googlegroups.com.


[web2py] Re: Navigation to /appadmin returns "invalid function (default/index)"

2020-06-30 Thread Massimo Di Pierro
Did you get it from github?
There was a recent change that maybe could have caused this:

https://github.com/web2py/web2py/commit/cf76978a390a70dfc36d3bfe64818fc0cc7226f3

Could you please revert it and see if it fixes your problem?

On Thursday, 25 June 2020 16:53:53 UTC-7, E T Bear wrote:
>
> Running on an Ubuntu 16.04 LTS system, under Nginx server with WSGI 
> handler wsgihandler.py.  Web2py updated to 2.20.4-stable.  Using a 
> PostgreSQL database.
>
> Suddenly, I can't navigate to /appadmin nor to /admin/..., get errors 
> like  "invalid function (default/index)" remotely over SSL, nor locally.  
> My own application continues to run well.
>
> Had no such problem before, running for several years.  Not sure when the 
> problem started since I don't visit /admin that often.  On my desktop 
> (running under Rocket) there's no such problem.  I have copied the whole 
> directory structure down from the server for comparison, and it is 
> identical to the version that lets me visit /appadmin on my desktop.
>
> It seems like a routing problem, admin/index never seems to get hit, but 
> my routes.py has not changed (my application is 'myapp' here):
>
> routers = dict(
> BASE = dict(
> default_application='myapp',
> )
> )
>
> Any clue or hint for where to look will be greatly appreciated.
>
>

-- 
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/2ec4a402-254e-405f-aa1d-87ec22763deco%40googlegroups.com.


[web2py] Re: Navigation to /appadmin returns "invalid function (default/index)"

2020-06-30 Thread Massimo Di Pierro


On Thursday, 25 June 2020 16:53:53 UTC-7, E T Bear wrote:
>
> Running on an Ubuntu 16.04 LTS system, under Nginx server with WSGI 
> handler wsgihandler.py.  Web2py updated to 2.20.4-stable.  Using a 
> PostgreSQL database.
>
> Suddenly, I can't navigate to /appadmin nor to /admin/..., get errors 
> like  "invalid function (default/index)" remotely over SSL, nor locally.  
> My own application continues to run well.
>
> Had no such problem before, running for several years.  Not sure when the 
> problem started since I don't visit /admin that often.  On my desktop 
> (running under Rocket) there's no such problem.  I have copied the whole 
> directory structure down from the server for comparison, and it is 
> identical to the version that lets me visit /appadmin on my desktop.
>
> It seems like a routing problem, admin/index never seems to get hit, but 
> my routes.py has not changed (my application is 'myapp' here):
>
> routers = dict(
> BASE = dict(
> default_application='myapp',
> )
> )
>
> Any clue or hint for where to look will be greatly appreciated.
>
>

-- 
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/e69da32e-4ede-4f3f-93da-f81684116acdo%40googlegroups.com.


[web2py] Re: Column auth_user.id not found BUT the column exists.

2020-06-30 Thread Massimo Di Pierro
Somehow the table in db contains the field but the model does not.
We need to see you model.

On Tuesday, 23 June 2020 07:10:32 UTC-7, Diego Tostes wrote:
>
>
> I am getting this error:
>
> Traceback (most recent call last):
>   File "/home/rebec/web2py/gluon/restricted.py", line 227, in restricted
> exec ccode in environment
>   File "/home/rebec/web2py/applications/lavanderia/views/appadmin.html" 
> , line 169, in 
> 
> dict( ratio=ram['ratio'], hits=ram['hits'], misses=ram['misses']))}}
>   File "/home/rebec/web2py/gluon/sqlhtml.py", line 3274, in __init__
> "Column %s not found (SQLTABLE)" % colname)
> KeyError: 'Column auth_user.id not found (SQLTABLE)'
>
>
> But when i check the DB:
>
> mysql> show columns in 
> auth_user;++--+--+-+-++|
>  Field  | Type | Null | Key | Default | Extra  
> |++--+--+-+-++|
>  id | int(11)  | NO   | PRI | NULL| auto_increment || 
> first_name | varchar(128) | YES  | | NULL||| 
> last_name  | varchar(128) | YES  | | NULL||| 
> email  | varchar(512) | YES  | | NULL||| 
> password   | varchar(512) | YES  | | NULL||| 
> registration_key   | varchar(512) | YES  | | NULL||| 
> reset_password_key | varchar(512) | YES  | | NULL||| 
> registration_id| varchar(512) | YES  | | NULL|
> |++--+--+-+-++8
>  rows in set (0.00 sec)
>
>

-- 
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/295ff7b2-17f4-40e9-a050-5e07758c5f09o%40googlegroups.com.


[web2py] Re: two Database syncrho

2020-06-30 Thread Massimo Di Pierro
Yes. Only on PostgreSQL, MySQL and Firebird. Assuming the feature has not 
been broken over time, I do not know of anybody who used it.

On Thursday, 11 June 2020 12:51:48 UTC-7, Ari Lion BR Sp wrote:
>
> Hi to all, 
>
> I am trying to  understand how to use the below feature:
>
> DAL.distributed_transaction_commit(db_a, db_b)
>
> mentined here:
>
> http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Distributed-transaction
>
> Does web2py does the synchro work, through DAL?
>
> Thanks!
>
>

-- 
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/f2ada571-a111-402f-826c-2ffda07a20a4o%40googlegroups.com.


[web2py] Re: streamed pyfpdf is stored with wrong fileencoding when using python3

2020-06-30 Thread Massimo Di Pierro
Try a few things things:


1) set content type to "application/*pdf"*
2) set content type to "application/*pdf**; charset=latin1"*

*3) *

*from io import BytesIOreturn BytesIO(pdf.output(dest='S'))*

On Monday, 20 April 2020 22:28:19 UTC-7, Armin Würtenberger wrote:
>
> Hi, 
>
> I am developing apps which are heavily depending on the creation of 
> pdf-files. This workes great using fpfdf and python2.7. I try to go on and 
> moving to pyhton3.7 which is, so far no problem. The real challenge for me 
> is to generate correct pdf-files:
>
> Heres how I did it in python2.7:
>
>
> @service.run
> def generatePDF(**kwargs):
> from gluon.contrib.fpdf import fpdf
> from gluon.contrib.fpdf.php import UTF8ToUTF16BE, UTF8StringToArray
> from gluon.contenttype import contenttype
>
> pdf = fpdf.FPDF("P","mm","a4")
> pdf.l_margin, pdf.r_margin = 20, 10
> pdf.add_font('Sans', '', 'DejaVuSansCondensed.ttf', uni=True)
> pdf.add_font('Sans', 'B', 'DejaVuSansCondensed-Bold.ttf', uni=True)
> pdf.add_font('Sans', 'I', 'DejaVuSansCondensed-Oblique.ttf', uni=True)
> pdf.add_font('Sans', 'BI', 'DejaVuSansCondensed-BoldOblique.ttf', uni=
> True)
> pdf.add_font('Serif', '', 'DejaVuSerifCondensed.ttf', uni=True)
> pdf.add_font('Serif', 'B', 'DejaVuSerifCondensed-Bold.ttf', uni=True)
> pdf.add_font('Serif', 'I', 'DejaVuSerifCondensed-Italic.ttf', uni=True
> )
> pdf.add_font('Serif', 'BI', 'DejaVuSerifCondensed-BoldItalic.ttf', uni
> =True)
> 
> pdf.add_page()
> pdf.set_font('Sans','B',20)
> pdf.set_y( 25 )
> pdf.cell( w=pdf.w-(pdf.l_margin+pdf.r_margin), h=25,
>   align="C",
>   border=1,
>   txt="Hello World", ln=2 )
>
> 
> response.headers["Content-Type"]=contenttype(".pdf")
> response.headers['Content-disposition'] = 'attachment; 
> filename=mypdf.pdf'
> 
> return pdf.output(dest='S')
>
>
> The downloaded file is a PDF, the file itself is latin1 encoded. (checked 
> with vim; set fileencoding)
>
> If I do the very same, using web2py and python3.7, I am getting the 
> pdf-file as byte-stream - starting with the b'
>
> b'%PDF-1.3\n3 0 obj\n<
>
> fileencoding utf-8, which I understand (somehow) since the fpdf does serve 
> a byte-stream.
>
> To overcome this, I tried to change the last line to:
>
>
> return pdf.output(dest='S').decode('latin1')
>
>
> and I get a file which is no valid pdf, fileencoding is utf-8
> Once I manually change the fileencoding of the downloaded file to latin1, 
> it becomes a valid and readable pdf-file.
>
> Using 
>
> pdf.output("myfile.pdf",dest='F')
>
> does produce a valid, latin1 - encoded file on disc however.
>
> I tried different variants as well, but I got stuck and was not able to 
> produce a valid pdf.
>
> Can someone suggest a way to produce a valid download?
> At first I was suspecting some missing response - header information, but 
> I did not find one which solved the problems.
>
> Any help would be appreciated!
>
> I am working on macOS, using Safari, but tried Firefox and Chrome as well 
> - same result.
>
> Cheers, Armin
>

-- 
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/1b4374a0-6e50-4ebb-8bed-0da4425b7f6ao%40googlegroups.com.


[web2py] Re: check url agrs / vars after #

2020-06-30 Thread Massimo Di Pierro
You cannot because the browser does not send those to the server. Your only 
option is to inject some JS in the page that reads it from 
window.location.hash and POST to an API, after the page is loaded.

On Sunday, 28 June 2020 07:37:54 UTC-7, Ari Lion BR Sp wrote:
>
>
> Hi, how to get / check 
>
> url agrs / vars after # symbol.
>
>
> I want to re-wright url without reload and get thwe args/varss of it.
> I see it happends  after # symbol.
>
> Regards
>

-- 
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/b29efb97-860e-49ec-85ed-a3d34adee770o%40googlegroups.com.


[web2py] Re: [py4web] - how to disable some auth actions?

2020-04-29 Thread Massimo Di Pierro
Some of this is now done.
Please help test it:

[X] Enable and disable 
plugins 
  

[X} Enable and disable 
actions 
  

[X] Require passwords of various 
complexity  


[x] Force logout after x hours 
(WIP)   
  

[X] No re-use of the last n 
passwords   
 

[ ] Force new password on first login 
(WIP)   
   

[ ] Two-factor authentication for users with 'administrator' 
access  


[ ] Lock account after x failed login 
attempts.   
   

[ ] Force new password every x days.  

You need to copy this form _scaffold/common.py

auth = Auth(session, db, define_tables=False)
auth.use_username = True
auth.registration_requires_confirmation = settings.VERIFY_EMAIL
auth.registration_requires_approval = settings.REQUIRES_APPROVAL
auth.allowed_actions = ['all']
auth.login_expiration_time = 3600
auth.password_complexity = {"entropy": 50}
auth.block_previous_password_num = 8
auth.define_tables()

And you also need the new _scaffold/static/components/auth.js and auth.html 
copied into your own app


Instead of a minimum complexity (entropy) you ca specify a min length, 
number of required upper/lower case chars, and number special chars.

auth.password_complexity = {"min": 8, "upper": 1, "lower": 1, "number": 1, 
"special":1}

Personally I think this is EVIL. This is against the most recent NIST 
recommendations. An entropy of 50 is better. It forces long passwords that 
are easier to remember.



On Monday, 30 March 2020 07:42:42 UTC-7, Peter wrote:
>
> This is exactly what I need/ do. One vote for this request.
>
> субота, 28. март 2020. 21.55.06 UTC+1, Paolo Caruccio је написао/ла:
>>
>> In my case I only need login and logout.
>> The creation of an account will be done by other users with privileges 
>> established by the administrators. The modification of the profile will 
>> also be done partially by the user himself (change password, change email, 
>> add / change personal data etc) who has the account enabled and is already 
>> logged in.
>> Obviously I can delete all links and specific functions from the 
>> frontend, as well as I can require to approve any registration made from 
>> the outside but it would be more secure to also do a server-side prevention 
>> by disabling actions that do not need.
>>
>>
>> Translated with www.DeepL.com/Translator (free version)
>>
>> Il giorno sabato 28 marzo 2020 20:30:48 UTC+1, Massimo Di Pierro ha 
>> scritto:
>>>
>>> not possible yet. I can implement it easily but I would like to 
>>> understand some use cases.
>>>
>>> On Saturday, 28 March 2020 10:12:32 UTC-7, Paolo Caruccio wrote:
>>>>
>>>> In py4web is there any way to disable some auth actions? I can't find 
>>>> anything in the code about this.
>>>>
>>>> In web2py this is possible via auth.settings.action_disabled
>>>>
>>>> For example:
>>>>
>>>> auth.settings.action_disabled=['register']
>>>>
>>>> prevents the "register" action from working.
>>>>
>>>> Tank you.
>>>>
>>>

-- 
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/df06b8c4-4276-4284-be6e-17de5e45c277%40googlegroups.com.


Re: [web2py] Re: Beginners question on Authentication ...

2020-04-26 Thread Massimo Di Pierro
Hello Jon,

unfortunately the documentation has been lagging. Recently we are putting a 
lot more efforts into py4web which, as you understood, is the natural 
successor of web2py. py4web is much cleaner and much faster. The Auth side 
is not quite as battle tested but we plan to release a new and improved 
Auth for py4web in a couple of weeks, maybe sooner. It is not quite true 
that py4web lacks the equivalent of web2py's grid. It is just different. 
py4web is designed for APIs and provides a mtable that generates grids 
client-side based on the APIs. There is a lot of new and better stuff in 
py4web which is undocumented but I will prioritize the py4web documentation.

Massimo



On Wednesday, 22 April 2020 15:15:43 UTC-7, Jon Paris wrote:
>
> P.S.
>
> Just using the one I was pointed to Jim - if you know of a better one I'd 
> be happy to hear it.
>
> The biggest problem appears to be that it was written long before a lot of 
> the "stuff" was added to the scaffold files. In some cases the tutorial 
> tells you to replace the whole file - but in others (as in this case) it 
> just tells you to add it without saying _where_.
>
>
> On Wednesday, April 22, 2020 at 5:49:45 PM UTC-4, Jim S wrote:
>>
>> 
>> I've just been looking at the tutorial you're following and see that it 
>> seems a bit out-dated.
>>
>> -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/a143888a-26af-4a62-a83a-340fd0cbcdeb%40googlegroups.com.


[web2py] Re: Why do my questions never show up?

2020-04-26 Thread Massimo Di Pierro
Hello Jon,

sorry again for the trouble with your questions. First post is always 
moderated to avoid spam so it may take some time. Once your first post is 
approved (and it is) you should not have any more trouble posting.

Massimo

On Tuesday, 21 April 2020 07:58:33 UTC-7, Jon Paris wrote:
>
> That would indeed be me Jim.  Thanks for the offer.  I've been using PHP 
> to good effect for many years now but wanted to explore something new and 
> Python is "hot" right now in the iBM i community.
>
> On Tuesday, April 21, 2020 at 9:46:28 AM UTC-4, Jim S wrote:
>>
>> Just curious, is this THE Jon Paris of RPG fame??
>>
>> If so, please hit me up with any questions, I'd love to help you any way 
>> I can.  I'm a long time AS/400 guy who has been using web2py since 2011.
>>
>> -Jim
>>
>> On Tuesday, April 21, 2020 at 12:28:20 AM UTC-5, Jon Paris wrote:
>>>
>>> I joined this group and posted two (related) questions.  No error 
>>> messages but neitrhewr have shown up.  I know I am subscribed because I am 
>>> seeing all the other posts to the forum in my email. 
>>>
>>> There is no group contact point listed in the emails so I'm trying this 
>>> reply to address. 
>>>
>>>
>>> Jon Paris
>>
>>

-- 
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/bb5a4ba5-1560-4311-a88b-0b77b5153c19%40googlegroups.com.


[web2py] Re: web2py online debugger under python3

2020-04-26 Thread Massimo Di Pierro
what browser?

On Monday, 30 March 2020 13:23:57 UTC-7, Clemens wrote:
>
> Hello everybody!
>
> I've switched my web2py app from python2 to python3. The app itself works 
> fine, but the web2py online debugger doesn't work anymore and is mostly 
> freezing. Sometimes a get the following error message:
>
> Exception timeout: timeout('timed out',)
>
> Traceback (most recent call last): File "/usr/lib/python3.6/socket.py", 
> line 586, in readinto return self._sock.recv_into(b) socket.timeout: timed 
> out
>
> My configuration is as follows:
>
> web2py 2.19.1-stable+timestamp.2020.03.21.21.49.28 (Running on Rocket 
> 1.2.6, Python 3.6.9), Ubuntu 18.04 LTS
>
> What do I have to change additionally that the online debugger is working 
> under python3?
>
>
> Thanks a lot for any support!
>
>
> Best regards Clemens
>

-- 
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/13895e39-6083-4d1f-8c21-e5efa13d1a97%40googlegroups.com.


[web2py] Re: [py4web] - how to disable some auth actions?

2020-04-26 Thread Massimo Di Pierro
Yes we should have these all but one. Will put it on the todo list. 
Rearranging in order of priority with some comments below:

1) Require passwords of various complexity (WIP= Work In Progress)
2) Force logout after x hours (WIP)
3) No re-use of the last password (WIP)
4) Force new password on first login (WIP)

5) Two-factor authentication for users with 'administrator' access
6) Lock account after x failed login attempts.
7) Force new password every x days.

NO) No sequential passwords (for example, can't change your password from 
'password1' to 'password2').
This is not possible because the server does not know the previous 
password, only the salted hash of it.
If a site enforces this, that site is storing your password in the clear 
and I'd recommend you not use 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/6cc5c37b-00b4-4695-affe-91cb51e267ef%40googlegroups.com.


[web2py] Re: web2py with python 2.7 and web2py running on python 3

2020-04-25 Thread Massimo Di Pierro
Can you please try these:

https://web2py.com/examples/static/nightly/web2py_win_py27.zip
https://web2py.com/examples/static/nightly/web2py_win_py37.zip
https://web2py.com/examples/static/nightly/web2py_osx_py27.zip
https://web2py.com/examples/static/nightly/web2py_osx_py37.zip

On Sunday, 29 March 2020 23:33:40 UTC-7, Jobin Antony wrote:
>
> c:\web2py>c:\python27\python.exe web2py.exe
>   File "web2py.exe", line 1
> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but 
> no encoding declared; see http://www.python.org/peps/pep-0263.html for 
> details
>
> c:\web2py>
>
> On Thursday, March 26, 2020 at 10:18:51 AM UTC+5:30, Dave S wrote:
>>
>>
>>
>> On Saturday, March 21, 2020 at 1:59:59 PM UTC-7, Andrea Fae' wrote:
>>>
>>> I have a windows 10 PC.
>>> I installed c:\python27 and c:\python3 and they are working. I can 
>>> choose.
>>>
>>> But if I try to start web2py it happens this error:
>>>
>>> c:\Python3>python.exe c:\web2py\web2py.py
>>> Traceback (most recent call last):
>>>   File "c:\web2py\web2py.py", line 21, in 
>>> import gluon.widget
>>>   File "c:\web2py\gluon\__init__.py", line 37, in 
>>> from .globals import current
>>>   File "c:\web2py\gluon\globals.py", line 24, in 
>>> from gluon.serializers import json, custom_json
>>>   File "c:\web2py\gluon\serializers.py", line 10, in 
>>> from gluon.languages import lazyT
>>>   File "c:\web2py\gluon\languages.py", line 19, in 
>>> from cgi import escape
>>> ImportError: cannot import name 'escape' from 'cgi' 
>>> (c:\Python3\lib\cgi.py)
>>>
>>> I found that changing "from cgi import escape" to "from html import 
>>> escape" it start but I don't knoy why.
>>>
>>> Nevertheless If I try to start an app built from Python27 I have this 
>>> error:
>>>
>>>  Failure to connect, tried 5 times: 
>>> Traceback (most recent call last): File 
>>> "C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__ 
>>> self._adapter = adapter(**kwargs) File 
>>> "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
>>> __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File 
>>> "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
>>> __init__ super(SQLAdapter, self).__init__(*args, **kwargs) File 
>>> "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in __init__ 
>>> self.reconnect() File "C:\web2py\gluon\packages\dal\pydal\connection.py", 
>>> line 172, in reconnect self.connection = self.connector() File 
>>> "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
>>> connector return self.driver.connect(**self.driver_args) File 
>>> "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect return 
>>> Connection(*args, **kwargs) File 
>>> "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__ 
>>> self.connect() File "C:\web2py\gluon\contrib\pymysql\connections.py", line 
>>> 905, in connect self._get_server_information() File 
>>> "C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
>>> _get_server_information self.server_charset = charset_by_id(lang).name File 
>>> "C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id return 
>>> self._by_id[id] KeyError: 255
>>>
>>> If I start the same app with web2py on python 2.7 changing back to "from 
>>> cgi import escape" and it's working.
>>> Maybe this is a problem regarding foreign-keys, I had one time in the 
>>> past but really... I don't remember how to fix.
>>>
>>> Thank you
>>>
>>>
>> Make sure you have separate directories for running under python 2.7 and  
>> python 3.x.
>> Files get compiled, and the .pyc is not portable between the two versions.
>>
>> /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/0df3101b-44e3-4752-b2f2-5659095ac701%40googlegroups.com.


[web2py] Update on web2py binaries

2020-04-25 Thread Massimo Di Pierro
First of all thanks to Nico Zanferrari for all his work on creating new 
binaries. It took me a while but I have now incorporated them into my 
deployment process. You can find them here:

https://web2py.com/examples/static/nightly/web2py_win_py27.zip
https://web2py.com/examples/static/nightly/web2py_win_py37.zip
https://web2py.com/examples/static/nightly/web2py_osx_py27.zip
https://web2py.com/examples/static/nightly/web2py_osx_py37.zip

There are still not linked but please check them out. If they work for you, 
I will link them as official binaries.
For more info on the build process

https://github.com/nicozanf/web2py-pyinstaller

I then have have a process on my VM that unpacks and repackages them when a 
new web2py version is released. That is why I need help in testing them. 
Making sure the re-packaging did not break anything.

Thanks.

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/70fc311f-6324-47ad-84b1-cbc3d025092f%40googlegroups.com.


[web2py] Re: Standard way of removing X-Powered-By: web2py http header?

2020-04-12 Thread Massimo Di Pierro
yes. This can be in the user's code:

response.headers['X-Powered-By'] = 'xping'

On Sunday, 12 April 2020 12:47:31 UTC-7, Alex Beskopilny wrote:
>
> cd web2py/gluon
> grep -r X-Powered-By
> ./globals.py:self.headers['X-Powered-By'] = 'xping'
>
>
> воскресенье, 12 апреля 2020 г., 16:02:13 UTC+3 пользователь Yan Wong 
> написал:
>>
>> I'm a bit disappointed that web2py by default sets `X-Powered-By: web2py` 
>> in the http header, thus making it easier for web-scanning tools to detect 
>> the software running behind a web site, and allow more targetted attacks. 
>> Is there an easy config option to efficiently turn this off for all pages / 
>> json responses etc served by web2py? Also, are there other ways to obscure 
>> the fact that it is web2py / python running on a web server, and reduce 
>> information disclosure? For example, can anyone detect what python version 
>> I'm running by using web queries: I see that rocket server puts the python 
>> version in the `Server:` header, which seems bad to me, although my 
>> production machine simply returns `Server: nginx` which is a little better, 
>> I suppose. I suspect it will never be possible to obscure the software 
>> entirely, but anything that makes it harder for the script kiddies seems 
>> like an easy win to me.
>>
>

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


[web2py] Re: 2.19.1 redis sessions problem

2020-03-29 Thread Massimo Di Pierro
Sorry. We should fix this. Will look into it asap.

On Sunday, 29 March 2020 15:38:27 UTC-7, Jim S wrote:
>
> FWIW - I've abandoned redis for sessions.  I can't get it to work reliably 
> and no one seems interested in fixing it.  I submitted some patches but 
> they were rejected.  So, I've moved my sessions into my database.  Not what 
> I wanted to do, but at least that works reliably.  Sorry to be negative 
> about this, it just seems it isn't a priority for the project.
>
> -Jim
>
>
> On Saturday, March 28, 2020 at 5:30:11 AM UTC-5, Jose C wrote:
>>
>> Just started testing version 2.19.1 (prior to upgrading) with py3.6 and 
>> it appears that when sessions are stored in redis, a new session is being 
>> created each time the login is submitted which then prevents a session from 
>> logging in.  
>>
>> This issue was discussed in 
>> https://groups.google.com/forum/#!msg/web2py/z1ee025ghRU/qByNuEjGAgAJ  
>> and Jim S found a workaround with the .decode function which worked on py3 
>> but not on py2 (and which I've been using live).  It looks like the redis 
>> session code has been refactored in 2.19.1 to remove all the decodes but I 
>> can't get it to work correctly.
>>
>> Can anyone confirm whether they have this issue when trying to login 
>> using redis sessions in 2.19.1 (with py3)?  If confirmed, I'll file a bug 
>> report.
>>
>> Thanks,
>>
>> Jose
>>
>

-- 
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/d829a9cb-620a-440f-bd1d-baea78d88a12%40googlegroups.com.


[web2py] Re: New-py4web-group

2020-03-28 Thread Massimo Di Pierro
Can you please try again?

On Saturday, 28 March 2020 12:54:43 UTC-7, Daniel Guilhermino wrote:
>
> You do not have permission to access this content. (# 418)
>
> I believe it is due to the recent creation of the group, I will try again 
> shortly.
>
> Tks!
>
> Em sábado, 28 de março de 2020 16:46:26 UTC-3, Massimo Di Pierro escreveu:
>>
>> We ave a new group for py4web questions and discussions:
>>
>> https://groups.google.com/forum/#!forum/py4web
>>
>> Please also use it for pydal, yatl, and pluralize questions.
>> For web2py specific questions, please use the per-existing group.
>>
>

-- 
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/31f0434b-a4a7-4828-84c8-a81f8b249e1a%40googlegroups.com.


[web2py] Re: [py4web] - how to disable some auth actions?

2020-03-28 Thread Massimo Di Pierro
Let me give some thought to this. Only complication is a mechanism for 
sever to tell auth.js that some pages should be available.

On Saturday, 28 March 2020 13:55:06 UTC-7, Paolo Caruccio wrote:
>
> In my case I only need login and logout.
> The creation of an account will be done by other users with privileges 
> established by the administrators. The modification of the profile will 
> also be done partially by the user himself (change password, change email, 
> add / change personal data etc) who has the account enabled and is already 
> logged in.
> Obviously I can delete all links and specific functions from the frontend, 
> as well as I can require to approve any registration made from the outside 
> but it would be more secure to also do a server-side prevention by 
> disabling actions that do not need.
>
>
> Translated with www.DeepL.com/Translator (free version)
>
> Il giorno sabato 28 marzo 2020 20:30:48 UTC+1, Massimo Di Pierro ha 
> scritto:
>>
>> not possible yet. I can implement it easily but I would like to 
>> understand some use cases.
>>
>> On Saturday, 28 March 2020 10:12:32 UTC-7, Paolo Caruccio wrote:
>>>
>>> In py4web is there any way to disable some auth actions? I can't find 
>>> anything in the code about this.
>>>
>>> In web2py this is possible via auth.settings.action_disabled
>>>
>>> For example:
>>>
>>> auth.settings.action_disabled=['register']
>>>
>>> prevents the "register" action from working.
>>>
>>> Tank you.
>>>
>>

-- 
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/019466c3-02ca-4a73-a995-d1d75e5772e7%40googlegroups.com.


[web2py] New-py4web-group

2020-03-28 Thread Massimo Di Pierro
We ave a new group for py4web questions and discussions:

https://groups.google.com/forum/#!forum/py4web

Please also use it for pydal, yatl, and pluralize questions.
For web2py specific questions, please use the per-existing group.

-- 
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/fa682bf7-5e53-45d6-aa72-302df7fd7edc%40googlegroups.com.


[web2py] Re: py4web group

2020-03-28 Thread Massimo Di Pierro
Yes it is time: https://groups.google.com/forum/#!forum/py4web

On Saturday, 28 March 2020 07:10:34 UTC-7, Daniel Guilhermino wrote:
>
> Hi/Ciao Massimo,
>
> I know that this question has already been raised, but I believe that for 
> the evolution of the number of people who will use py4web, would it not be 
> the time to dismember this group?
>
> There is research field that can be used, but this mix of framworks is 
> very polluted and confusing, especially for the first users.
>
> Best regards,
>
> Daniel Guilhermino
>

-- 
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/b2f54a13-738a-4b42-b015-4e135811c46b%40googlegroups.com.


[web2py] Re: [py4web] - how to disable some auth actions?

2020-03-28 Thread Massimo Di Pierro
not possible yet. I can implement it easily but I would like to understand 
some use cases.

On Saturday, 28 March 2020 10:12:32 UTC-7, Paolo Caruccio wrote:
>
> In py4web is there any way to disable some auth actions? I can't find 
> anything in the code about this.
>
> In web2py this is possible via auth.settings.action_disabled
>
> For example:
>
> auth.settings.action_disabled=['register']
>
> prevents the "register" action from working.
>
> Tank you.
>

-- 
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/055a8b27-25eb-47b6-a3b4-d945dfd3914c%40googlegroups.com.


Re: [web2py] web2py 2.19.1 is OUT

2020-03-24 Thread Massimo Di Pierro
So far yes.
Nico has been working on new binaries and a new system for packing them. 
The plan is to ship both 2.7 and 3.7.

On Tuesday, 24 March 2020 18:49:06 UTC-7, jim kaubisch wrote:
>
> Hi Nico,
>
> Just want to make sure I understand.
>
> You say 'web2py 2.19.1 binaries come "with embedded Python 2.7.16 or 
> 3.7.4" ' ??
> My reading is that one MUST get web2py source in order to use other 
> versions of Python? Am I understanding correctly?
>
> We are on macOS Catalina, python 3.7.6 and, given that python 3.8.2 claims 
> better integration with Catalina and python.org saying "We plan to 
> continue to provide bugfix releases for 3.7.x until mid 2020...", going 
> back to 3.7.4 doesn't appeal.
>
> Thanks
> Jim
>
>
> On Sunday, March 22, 2020 at 4:01:40 PM UTC-7, Nico Zanferrari wrote:
>>
>> Hello,
>>
>> the 2.19.1 web2py binaries are ready to be tested & used, with embedded 
>> Python 2.7.16 or 3.7.4. Grab them from my repository 
>> <https://github.com/nicozanf/web2py-pyinstaller> .
>> It has taken me a lot of time for updating to the latest PyInstaller 3.6 
>> and find a new missing import ;-)
>>
>> @Massimo: please update the Legacy and Normal binaries on 
>> http://www.web2py.com/init/default/download accordingly.
>>
>> Cheers,
>> Nico
>>
>>
>> Il giorno dom 22 mar 2020 alle ore 03:50 Lovedie JC  
>> ha scritto:
>>
>>> I've updated it.
>>> Flawless 
>>> 
>>> Good work. Much appreciated. 
>>> Regards 
>>>
>>> On Sun, Mar 22, 2020, 04:28 Christian Varas  wrote:
>>>
>>>> Thanks! 
>>>>
>>>> El El sáb, 21 de mar. de 2020 a la(s) 18:52, Massimo Di Pierro <
>>>> massimo...@gmail.com> escribió:
>>>>
>>>>> Sorry it took so long.
>>>>>
>>>>> Web2py 2.19.1 is finally out.
>>>>>
>>>>> It contains many small bug fixes including better support for python 
>>>>> 3.6, 3.7, and 3.8
>>>>>
>>>>> https://travis-ci.org/github/web2py/web2py
>>>>>
>>>>> -- 
>>>>> 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 web...@googlegroups.com.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/web2py/c432d75b-bfdc-414c-b110-f6e7bfc0265d%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/web2py/c432d75b-bfdc-414c-b110-f6e7bfc0265d%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>>> 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 web...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/web2py/CA%2Bs%2BuJsMSc4GhYHR9VpsJycKAdCzSr8vQK30WwBPmJOLQg2BLA%40mail.gmail.com
>>>>  
>>>> <https://groups.google.com/d/msgid/web2py/CA%2Bs%2BuJsMSc4GhYHR9VpsJycKAdCzSr8vQK30WwBPmJOLQg2BLA%40mail.gmail.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> -- 
>>> 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 web...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/CAAcHJF8dZTRrYnLmfVwmq_gZe6Gz3w%2BiqXRxT1h2qdE7X_6Dgg%40mail.gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/web2py/CAAcHJF8dZTRrYnLmfVwmq_gZe6Gz3w%2BiqXRxT1h2qdE7X_6Dgg%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>>

-- 
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/2f3191a5-9cb7-42fa-b23e-a9cb816e0c74%40googlegroups.com.


[web2py] Re: python3 + web2py + Lighttpd + fastcgi

2020-03-23 Thread Massimo Di Pierro
I guess we would have to replace calls to thread. to threading.

Why not use nginx which is kind of the standard today?

-- 
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/904fc08d-5ebf-4dfa-9bde-89a6f7796a9b%40googlegroups.com.


[web2py] Re: py4web in Google App Engine route app

2020-03-23 Thread Massimo Di Pierro
There are two problems here:
1) you cannot symlink in an action because it must be done once and only 
once.
2) You cannot have paths like /_default because they are absolute paths

Assuming this is a linux or OSX machine you should do from the shell

$ rm -rf apps/_default
$ ln -s apps/myapp apps/_default

You only need to do this once.

On Monday, 23 March 2020 05:01:41 UTC-7, Jacinto Parga wrote:
>
> Yes, but I get an error with symlink in __init.py__ of _default: 
>
> from py4web import action, __version__
> import os
>
> @action("index")
> @action.uses("index.html")
> def index():
> src = "/_default"
> dst = "/myapp"
> os.symlink(src, dst)
> return dict(version=__version__)
>
>
> Error Ticket: [Errno 13] Permission denied: '/_default' -> '/myapp'
>
> Traceback (most recent call last):
>   File "/home/jacinto/PROGRAMACION/py4web/py4web/core.py", line 554, in 
> wrapper
> ret = func(*func_args, **func_kwargs)
>   File "/home/jacinto/PROGRAMACION/py4web/py4web/core.py", line 515, in 
> wrapper
> ret = func(*args, **kwargs)
>   File "apps/_default/__init__.py", line 10, in index
> os.symlink(src, dst)
> PermissionError: [Errno 13] Permission denied: '/_default' -> '/myapp'
>
> id 48
> uuid 8b97b87a-7ec0-4158-bace-e414438f513a
> app_name _default
> method GET
> path /
> timestamp datetime.datetime(2020, 3, 23, 11, 48, 18)
> client_ip 127.0.0.1
> error [Errno 13] Permission denied: '/_default' -> '/myapp'
> snapshot 
> timestamp 2020-03-23T11:48:18.745672
> python_version 3.7.5 (default, Nov 20 2019, 09:21:52) 
>
>
>
>
>
>
> El sábado, 21 de marzo de 2020, 8:03:00 (UTC+1), Massimo Di Pierro 
> escribió:
>>
>> This is a good solution. One trick is to symlink _default to myapp
>>
>> On Monday, 16 March 2020 02:17:56 UTC-7, Jacinto Parga wrote:
>>>
>>> Finally solved.
>>>
>>>1. I add an entrypoint to the app.yaml . The app runs fine:
>>>runtime: python37
>>>entrypoint: gunicorn -b :8080 -w 2 main:app 
>>>
>>>
>>># Handlers define how to route requests to your application.
>>>handlers:
>>>
>>>- url: /.*
>>>  secure: always
>>>  redirect_http_response_code: 301
>>>  script: auto
>>>
>>>2. I get rid off all the apps but the default app and the app I want 
>>>to deploy in the .gcloudignore:
>>># This file specifies files that are *not* uploaded to Google Cloud 
>>>Platform
>>># using gcloud. It follows the same syntax as .gitignore, with the 
>>>addition of
>>># "#!include" directives (which insert the entries of the given 
>>>.gitignore-style
>>># file at that point).
>>>#
>>># For more information, run:
>>>#   $ gcloud topic gcloudignore
>>>#
>>>.gcloudignore
>>># If you would like to upload your .git directory, .gitignore file 
>>>or files
>>># from your .gitignore file, remove the corresponding line
>>># below:
>>>.git
>>>.gitignore
>>>
>>># Python pycache:
>>>__pycache__/
>>># Ignored by the build system
>>>/setup.cfg
>>>
>>>.travis.yml
>>>*.pyc
>>>*.pyo
>>>*~
>>>#*
>>>*.1
>>>*.bak
>>>*.bak2
>>>*.svn
>>>*.w2p
>>>*.class
>>>*.rej
>>>*.orig
>>>Thumbs.db
>>>.DS_Store
>>>./deposit
>>>./benchmark
>>>./build
>>>./dist
>>>./ssl
>>>./docs
>>>./logs
>>>./*.zip
>>># Only ignore the default app and the app we want to deploy
>>>env/*
>>>env/
>>>!apps/*
>>>apps/todo
>>>apps/todo/*
>>>apps/examples
>>>apps/examples/*
>>>apps/_dashboard
>>>apps/_dashboard/*
>>>apps/_scaffold
>>>apps/_scaffold/*
>>>apps/_minimal
>>>apps/_minimal/*
>>>!apps/_default
>>>!apps/_default/*
>>>!apps/myapp
>>>!apps/myapp/*
>>>apps/_documentation/*
>>>apps/superheroes
>>>apps/superheroes/*
>>>apps/myfeed
>>>apps/myfeed/*
>>>apps/*/databases/READ

[web2py] Re: python3 + web2py + Lighttpd + fastcgi

2020-03-22 Thread Massimo Di Pierro
I just fixed these issues and a few more. still skeptical this works with 
py3 without more changes. Thanks for you help


On Saturday, 21 March 2020 20:12:01 UTC-7, patito feo wrote:
>
> Thank you Massimo.
>
> As a result the code now shows more "L" cases, i just removed them. But 
> now it presents incompatibilities with exceptions and raises.
>
>   File , line 618
> def _end(self, appStatus=0L, protocolStatus=FCGI_REQUEST_COMPLETE):
>   ^
> SyntaxError: invalid syntax
>
>   File , line 1080
> except select.error, e:
>^
> SyntaxError: invalid syntax
>
>
>   File , line 1134
> raise NotImplementedError, self.__class__.__name__ + '.handler'
>  ^
> SyntaxError: invalid syntax
>
>
>   File , line 1317
> name, cgi.escape(`environ[name]`))
>  ^
> SyntaxError: invalid syntax
>
>
> As i told you before the "L" cases i fixed them, but this others errors 
> dont know how to fixed them.
>
>
> Thanks for your help.
>
>
>
> El sábado, 21 de marzo de 2020, 20:26:06 (UTC-5), Massimo Di Pierro 
> escribió:
>>
>> Fixed right now on github. Python 3 does not like the L
>>
>> On Saturday, 21 March 2020 16:11:38 UTC-7, patito feo wrote:
>>>
>>> Hi all,
>>>
>>> I've been trying to run web2py using python3 but unable to do it 
>>> sucessful.
>>> Using latest build 2.19.1
>>>
>>> I keep getting this error:
>>>
>>>  Traceback (most recent call last):
>>>   File "/folder/folder/folder/fcgihandler.py", line 44, in 
>>> import gluon.contrib.gateways.fcgi as fcgi
>>>   File "/folder/folder/folder/gluon/contrib/gateways/fcgi.py", line 439
>>> s = struct.pack('!L', nameLength | 0x8000L)
>>>  ^
>>> SyntaxError: invalid syntax
>>>
>>> Please help me find a solution or a replacement.
>>>
>>>
>>> Cheers,
>>>
>>

-- 
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/35369cb1-e477-4cf9-b4e7-cddc84c0a072%40googlegroups.com.


Re: [web2py] web2py 2.19.1 is OUT

2020-03-21 Thread Massimo Di Pierro
Let me know when ready. 

On Saturday, 21 March 2020 16:12:13 UTC-7, Nico Zanferrari wrote:
>
> Thanks Massimo!
>
> Please note that the binaries listed on 
> http://www.web2py.com/init/default/download are supposed to be the new 
> ones with Pyinstaller, but in fact they are the old broken ones.
> I'm working for buiding the new binaries - you cannot just replace the 
> sources inside because the main web2py.py program has been changed.
>
> Nico
>
> Il giorno sab 21 mar 2020 alle ore 22:52 Massimo Di Pierro <
> massimo.dipie...@gmail.com> ha scritto:
>
>> Sorry it took so long.
>>
>> Web2py 2.19.1 is finally out.
>>
>> It contains many small bug fixes including better support for python 3.6, 
>> 3.7, and 3.8
>>
>> https://travis-ci.org/github/web2py/web2py
>>
>> -- 
>> 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/c432d75b-bfdc-414c-b110-f6e7bfc0265d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/c432d75b-bfdc-414c-b110-f6e7bfc0265d%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/d67e1263-62b6-4ff1-90de-aa41b10a81b0%40googlegroups.com.


[web2py] Re: python3 + web2py + Lighttpd + fastcgi

2020-03-21 Thread Massimo Di Pierro
Fixed right now on github. Python 3 does not like the L

On Saturday, 21 March 2020 16:11:38 UTC-7, patito feo wrote:
>
> Hi all,
>
> I've been trying to run web2py using python3 but unable to do it sucessful.
> Using latest build 2.19.1
>
> I keep getting this error:
>
>  Traceback (most recent call last):
>   File "/folder/folder/folder/fcgihandler.py", line 44, in 
> import gluon.contrib.gateways.fcgi as fcgi
>   File "/folder/folder/folder/gluon/contrib/gateways/fcgi.py", line 439
> s = struct.pack('!L', nameLength | 0x8000L)
>  ^
> SyntaxError: invalid syntax
>
> Please help me find a solution or a replacement.
>
>
> Cheers,
>

-- 
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/770bab28-dd87-46f9-ac17-171a72d89cee%40googlegroups.com.


[web2py] web2py 2.19.1 is OUT

2020-03-21 Thread Massimo Di Pierro
Sorry it took so long.

Web2py 2.19.1 is finally out.

It contains many small bug fixes including better support for python 3.6, 
3.7, and 3.8

https://travis-ci.org/github/web2py/web2py

-- 
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/c432d75b-bfdc-414c-b110-f6e7bfc0265d%40googlegroups.com.


[web2py] Re: error

2020-03-21 Thread Massimo Di Pierro
Sorry. need more info. What has coursera got to do with web2py?

On Friday, 20 March 2020 23:20:09 UTC-7, Rashdan Hadri wrote:
>
> I cant seem to log in when i get redirected from COursera python basics
>
>

-- 
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/c1c68af3-ce05-4c54-916d-f08932c97d33%40googlegroups.com.


[web2py] Re: tailwindcss with web2py ?

2020-03-21 Thread Massimo Di Pierro
The barrier of entry seems pretty high. What do you like about it?

On Friday, 20 March 2020 04:37:23 UTC-7, Ramos wrote:
>
> any thoughts about tailwindcss ?
>
> Seems to me that could be the best option for web2py as it is very 
> programable as we all like :)
>
> just one nice thing i like...
> https://tailwindcss.com/docs/extracting-components  
>

-- 
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/0acd12fc-b296-453e-831c-41bd44951ce6%40googlegroups.com.


[web2py] Re: web2py 2.18.5 breaks mysql connection

2020-03-21 Thread Massimo Di Pierro
This week-end.

On Tuesday, 17 March 2020 12:33:23 UTC-7, Donald McClymont wrote:
>
> Any update on when 2.18.6 will be released - or is there an accepted 
> workaround other than taking latest version?  This seems a rather 
> fundamental bug when you upgrade a mysql setup?
>
> Regards
> Donald
>
> On Friday, April 12, 2019 at 4:59:55 AM UTC+1, Massimo Di Pierro wrote:
>>
>> will release 2.18.6 asap. fixed in pydal master
>>
>> On Tuesday, 9 April 2019 17:43:43 UTC-7, var...@seas.upenn.edu wrote:
>>>
>>>
>>> Commit 59a9260c5d7b5677d207a90798c1058779dfe871 adds the following line 
>>> to gluon/packages/dal/pydal/adapters/mysql.py (line 44 in 2.18.5):
>>>
>>> self.driver_args['password'] = password
>>>
>>> This does not work with MySQLdb.py.  "TypeError: \'password\' is an 
>>> invalid keyword argument for this function\n'"  It needs to be
>>>
>>> self.driver_args['passwd'] = password
>>>
>>> Making this change in my copy of the source fixes the problem.  Could 
>>> you please fix this in web2py?
>>>
>>> Thanks
>>>
>>> Kris
>>>
>>

-- 
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/64d4f518-1576-4143-ac8f-769772d70a1d%40googlegroups.com.


[web2py] Re: Error (web2py on GAE): ImportError: No module named gluon.settings

2020-03-21 Thread Massimo Di Pierro
Maybe the file got deleted or corrupted or excluded fro deployment? It 
exists in web2py.

On Tuesday, 17 March 2020 12:21:43 UTC-7, PRACHI VAKHARIA wrote:
>
> *web2py on GAE* gives the following error:
>
>
> *ImportError: No module named gluon.settings 
> (/base/data/home/apps/s~appname/appversion.425325282173601763/gaehandler.py:47)*
>
> Everything was working fine.
> Can someone enlighten what is happening?
>

-- 
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/fbc7a6d2-ac1e-47ce-b80f-74bd120cee4c%40googlegroups.com.


[web2py] Re: MacOS Catalina, Apache SSL

2020-03-21 Thread Massimo Di Pierro
Do not use apache. You do not need it. f you need to serve from outside to 
osx, consider nginx.

On Tuesday, 17 March 2020 08:42:48 UTC-7, Karl McHugh wrote:
>
> I'm having trouble setting up web2py with the following setup:
>
> MacOS Catalina,
> Apache,
> SSL
> web2py
>
> I've been unable to install apache modules. Is this because of the new 
> System Integrity Protection (SIP)? Would anyone with more experience be 
> able to point me in the right direction?
>
> Thanks
>
>

-- 
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/24363fe0-ea20-4bf6-b118-22a163bada10%40googlegroups.com.


[web2py] Re: py4web in Google App Engine route app

2020-03-21 Thread Massimo Di Pierro
This is a good solution. One trick is to symlink _default to myapp

On Monday, 16 March 2020 02:17:56 UTC-7, Jacinto Parga wrote:
>
> Finally solved.
>
>1. I add an entrypoint to the app.yaml . The app runs fine:
>runtime: python37
>entrypoint: gunicorn -b :8080 -w 2 main:app 
>
>
># Handlers define how to route requests to your application.
>handlers:
>
>- url: /.*
>  secure: always
>  redirect_http_response_code: 301
>  script: auto
>
>2. I get rid off all the apps but the default app and the app I want 
>to deploy in the .gcloudignore:
># This file specifies files that are *not* uploaded to Google Cloud 
>Platform
># using gcloud. It follows the same syntax as .gitignore, with the 
>addition of
># "#!include" directives (which insert the entries of the given 
>.gitignore-style
># file at that point).
>#
># For more information, run:
>#   $ gcloud topic gcloudignore
>#
>.gcloudignore
># If you would like to upload your .git directory, .gitignore file or 
>files
># from your .gitignore file, remove the corresponding line
># below:
>.git
>.gitignore
>
># Python pycache:
>__pycache__/
># Ignored by the build system
>/setup.cfg
>
>.travis.yml
>*.pyc
>*.pyo
>*~
>#*
>*.1
>*.bak
>*.bak2
>*.svn
>*.w2p
>*.class
>*.rej
>*.orig
>Thumbs.db
>.DS_Store
>./deposit
>./benchmark
>./build
>./dist
>./ssl
>./docs
>./logs
>./*.zip
># Only ignore the default app and the app we want to deploy
>env/*
>env/
>!apps/*
>apps/todo
>apps/todo/*
>apps/examples
>apps/examples/*
>apps/_dashboard
>apps/_dashboard/*
>apps/_scaffold
>apps/_scaffold/*
>apps/_minimal
>apps/_minimal/*
>!apps/_default
>!apps/_default/*
>!apps/myapp
>!apps/myapp/*
>apps/_documentation/*
>apps/superheroes
>apps/superheroes/*
>apps/myfeed
>apps/myfeed/*
>apps/*/databases/README*
>pps/*/databases/*
>apps/*/uploads/*
>apps/*/*.py[oc]
>packages/
>deployment_tools/*
>deployment_tools/
>tests/*
>tests/
>README.md
>test-requirements.txt
>source-context.json
>password.txt
>py4web-start.py
>setup.py
>Makefile
>So when it is deployed in GAE http://myapp.appspot.com/ goes to 
>_default/index.html url
>3. I modify the __init.py__ file of the _default app to redirect to 
>myapp folder:
>from py4web import action, __version__
>from bottle import redirect  #get redirect function from bottle
>
>@action("index")
>@action.uses("index.html")
>def index():
>  redirect("/myapp")  # The former code: return 
>dict(version=__version__)
>The result is that http://myapp.appspot.com/ serves 
>http://myapp.app.com/myapp
>
> Maybe there is a more elegant way to get it. Any suggestion would be 
> appreciated.
>
> Thanks
>
> El martes, 4 de febrero de 2020, 19:46:32 (UTC+1), Jacinto Parga escribió:
>>
>> I cannot properly deploy a simple py4web app in GAE. I think it's just a 
>> .gcloudignore or a app.yaml configuration issue. The only thing I've got is 
>> a not found page.
>>
>> [image: minimal-py4web.png]
>>
>> Some help about how to route the right app in the google app engine?
>>
>> Thanks
>>
>>
>>
>>

-- 
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/2a1f1673-74ec-4ccd-a547-aee5e8074dd0%40googlegroups.com.


[web2py] Re: 6th book release

2020-03-21 Thread Massimo Di Pierro
The book online has some edits. Not major.

On Saturday, 14 March 2020 10:47:47 UTC-7, Andrea Fae' wrote:
>
> What are the differences between 5th book release and 6th online book 
> prerelease?
> thank you
>

-- 
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/0e5dcc3d-2951-471c-9932-e6d571a39df9%40googlegroups.com.


Re: [web2py] DId.app auth is good for web2py apps ?

2020-03-21 Thread Massimo Di Pierro
Did you get this to work. This is very valuable. I can help fix it during 
the week-end. Not going anywhere. ;-)


On Friday, 13 March 2020 06:00:40 UTC-7, Kevin Keller wrote:
>
> You need to change your okta tenant URLs  and the client Id and Secret. 
>
> I still points to my tenant :) 
>
>
>
>
> On Thu, Mar 12, 2020 at 3:05 PM Kevin Keller  wrote:
>
>> This goes into your db.py and you also need to install okta_jwt via pip. 
>>
>> I still haven figured it out how to terminate the session in Okta and 
>> Web2py at the same time
>>
>> The redirect in the logout terminates the okta session but not the web2py 
>> one.
>> For that you need session.forget and session.renew but this commands 
>> being in the model dont work, they only work in the controller. 
>> So need to find a way to destroy the sessions in the models through some 
>> sort of global variable or store the sessions in the DB retrieve them in 
>> the model and detroy them there. 
>>
>>
>>
>> On Thu, Mar 12, 2020 at 3:02 PM Kevin Keller  wrote:
>>
>>> Okta_CLIENT_ID='0x'
>>> Okta_CLIENT_SECRET="x"
>>>
>>> ## import required modules
>>> try:
>>> import json
>>> except ImportError:
>>> from gluon.contrib import simplejson as json
>>> from gluon.contrib.login_methods.oauth20_account import OAuthAccount
>>>
>>>
>>> ## extend the OAUthAccount class
>>> class OktaAccount(OAuthAccount):
>>> # """OAuth impl for FaceBook"""
>>> AUTH_URL="https://keller.okta.com/oauth2/default/v1/authorize;
>>> TOKEN_URL="https://keller.okta.com/oauth2/default/v1/token;
>>>
>>> def __init__(self):
>>> OAuthAccount.__init__(self, None, Okta_CLIENT_ID, Okta_CLIENT_SECRET,
>>> self.AUTH_URL, self.TOKEN_URL,
>>> scope='openid profile email',
>>> state="okta",
>>> display='popup')
>>>
>>>
>>> def get_user(self):
>>> if not self.accessToken():
>>> return None
>>> #global token
>>> token= None
>>> token=self.accessToken()
>>> print (token)
>>> from okta_jwt.jwt import validate_token
>>> issuer="https://keller.okta.com/oauth2/default;
>>> audience="api://default"
>>> if token != None:
>>> profile=validate_token(token, issuer, audience, Okta_CLIENT_ID)
>>> #print (profile)
>>> if profile['sub']:
>>>
>>> username = profile['sub']
>>>
>>>
>>> email = profile['sub']
>>> else:
>>> self.session.token = None
>>>
>>> if profile['sub']:
>>> return dict(first_name = profile['firstname'],
>>> last_name = profile['lastname'],
>>> username = username,
>>> email = '%s' %(email))
>>>
>>>
>>> def logout_new(self, next="/"):
>>> #self.session.token = None
>>> redirect('
>>> https://keller.okta.com/oauth2/default/v1/logout?id_token_hint='+token+
>>> '_logout_redirect_uri='+'
>>> http://130.61.243.125:8000/OktaWF/default/index')
>>> session.renew(clear_session=True)
>>> session.forget(response)
>>> return next
>>>
>>>
>>> auth.settings.login_form=OktaAccount()
>>>
>>> On Wed, Mar 11, 2020 at 4:01 PM António Ramos  
>>> wrote:
>>>
 Thank you Kevin , please share...


 Em qua., 11 de mar. de 2020 às 14:53, Kevin Keller  
 escreveu:

> Looks nice enough, though it is missing an easy way to configure 
> scopes and claims. 
>
> It dont see it anywhere in their free account actually. 
>
> I would probably rather advice to go with Auth0 or Okta. 
>
> I work for Okta so that is why I have integrated web2py with Okta in a 
> sample app. 
> I can send you the configuration and they have a free edition too for 
> 1000 users per month just like 
> DID and you can easily configure claims and scopes. 
>
> If you do not trust me on this go with Auth0, they can also help with 
> claims and scopes and I think 
> its free for 1000 users too, but Auth0 requires to do some scripting 
> to configure your scopes on the Auth0 web client. 
>
> So I think Okta is easier, but its just my 2 cents of course. 
>
>
>
>
> On Wed, Mar 11, 2020 at 2:02 PM António Ramos  
> wrote:
>
>> DID  is an Identity Provider, that authenticates 
>> users by verifying access to either an email address or securely stored 
>> private key.
>>
>> This gives users the ability to sign in with a single click without 
>> being tracked by the social login providers.
>>
>> It gives developers the ability to offer a modern authentication 
>> without having to handle validating signatures, recovering accounts from 
>> lost devices or verifying user email addresses.
>>
>>
>>
>> https://did.app/ 
>>
>>
>> regards 
>>
>> -- 
>> 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, 

Re: [web2py] pyweb login

2020-03-21 Thread Massimo Di Pierro
Try rm -rf app and 

python3.7 -m pip install -U py4web

I think you have an old buggy version
On Monday, 9 March 2020 14:43:47 UTC-7, Maurice Waka wrote:
>
> still getting same results.
> see image attached.
>
>
> On Tue, Mar 10, 2020 at 12:25 AM Jim S  wrote:
>
>> Can you now run
>>
>>
>> py4web-start -c new_apps
>>
>> -Jim
>>
>>
>> On Monday, March 9, 2020 at 4:07:13 PM UTC-5, Maurice Waka wrote:
>>>
>>> FYI
>>>
>>>
>>>
>>> On Mon, Mar 9, 2020 at 9:34 PM Jim S  wrote:
>>>
 When you say 'downloaded the py4web', how did you do it?  

 Have you pip installed py4web in the past?

 Can you cut and paste all of your terminal commands and output here to 
 recreate the problem?

 -Jim

 On Monday, March 9, 2020 at 1:26:16 PM UTC-5, Maurice Waka wrote:
>
> Hi Jim
> I havent done anything yet in coding.
> I just removed all apps, downloaded the py4web but the above 
> errors come with opera browser.
> Regards
>
> On Mon, Mar 9, 2020 at 2:25 AM Jim S  wrote:
>
>> Maybe show the code?  The more code you show the more we can help.
>>
>> -Jim
>>
>> On Sunday, March 8, 2020 at 8:51:15 AM UTC-5, Val K wrote:
>>>
>>> It is strange because opera is chromium based. Keep in mind that 
>>> 'disable cache' takes effect if only console is opened. Are there any 
>>> errors in console during page reloading?
>>
>> -- 
>> 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/pBFfw8y9Bic/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/4e3ba7a1-f16a-44c6-aa99-bcf9f685bdef%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 a topic in the 
 Google Groups "web2py-users" group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/web2py/pBFfw8y9Bic/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/web2py/a3bc3bc0-8a11-4887-a250-d51563515798%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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/pBFfw8y9Bic/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/3b797da7-940d-4f3e-bb99-e8e1884629bd%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/44987135-60f2-4eba-b0cb-dc446faee380%40googlegroups.com.


[web2py] Re: Py4Web fields of type 'upload' not working

2020-03-21 Thread Massimo Di Pierro
Please open a ticket about this.

On Monday, 9 March 2020 03:42:54 UTC-7, John Bannister wrote:
>
> Hi All,
>
> Still struggling a lot with fields of type 'upload'. Whatever I try the 
> field remains None. Any help greatly appreciated.
>
> Typical use case is as follows:
>
> Model:
> db.define_table('test',
> Field('f_name'),
> Field('l_name'),
> Field('image', 'upload', default='test'))
>
> Controller:
> @action('test', method=['GET','POST'])
> @action.uses('generic.html', session, db, T)
> def test():
> page_title = 'Test'
> messages=[]
> my_dict = request.query.decode()
> post_vars = request.forms
> form=Form(db.test)
> print ('Form vars before are %s' % form.vars)
> if form.accepted:
> print('inside form accepted')
> print ('Form vars are %s' % form.vars)
> elif form.errors:
> messages.append('form %s has errors: %s ' % (form.form_name, 
> form.errors))
> return dict(form=form, page_title=page_title, messages=messages)
>
> All fields/form.vars etc are okay except for image which is always None.
>
> All help greatly appreciated
> John
>

-- 
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/16053fc7-d2e2-4b43-8126-b926303e646d%40googlegroups.com.


[web2py] Re: Py4web readonly Form

2020-03-21 Thread Massimo Di Pierro
You may be right but what is the meaning of submitting and accepting a 
readonly form? What is a use case?

On Friday, 6 March 2020 00:53:17 UTC-8, John Bannister wrote:
>
> Hi All,
>
> I have been testing Py4web and have the following to produce basically a 
> 'view record' option :-
>
> def view_test():
> form=Form(db.auth_user, record=1, readonly=True, deletable=False, 
> formstyle=FormStyleBulma)
> if form.accepted:
> redirect(URL('index'))
> return dict(form=form)
>
> This will redirect if I remove the readonly=True from the form but 
> basically form is just displayed (all fields are readonly) and you can hit 
> the submit button as many times as you like and nothing will happen.
>
> Any ideas??
>
> BR
> John
>
>

-- 
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/2089781a-8a2e-4b62-90d4-98a6183b375b%40googlegroups.com.


[web2py] Re: how to expire sessions in py4web

2020-03-21 Thread Massimo Di Pierro
Session and login information are not same. The latter is stored in the 
former. When you logout it clears the login info in the session but does 
not clear the session. There is no need. You can of course do 
session.clear() if you want.

Sessions tells py4web (or web2py) that you are the same user as before. 
auth tells who you are and what you are authorized to do. 

On Tuesday, 3 March 2020 19:03:37 UTC-8, Carlos Hanson wrote:
>
> In chapter 4 of the documentation:
>
> By default py4web sessions never expire (unless they contain login 
>> information, but that is another story) even if an expiration can be set. 
>
>
> I see the truth in that statement, since I set the expiration in the 
> session, but my session never expires. 
>
>
> session = Session(secret=settings.SESSION_SECRET_KEY, expiration=settings.
> SESSION_EXPIRATION)
>
>
> What is the story about sessions containing login information? How do I 
> ensure I am not logged in forever?
>
> Thanks.
>
> Carlos
>

-- 
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/858b1d31-2e0a-47b7-bee2-ce91dcc3c9ba%40googlegroups.com.


Re: [web2py] Re: off topic - Alpine JS as an alternative to vuejs/react

2020-03-21 Thread Massimo Di Pierro
I tried Alpine. It is very slow compared to vue.js. For me it was a 
non-starter.

On Friday, 28 February 2020 07:21:27 UTC-8, Ramos wrote:
>
> maybe this is helpful
>
> https://www.alpinetoolbox.com/  
>
> Em sex., 28 de fev. de 2020 às 06:19, Massimo Di Pierro <
> massimo.dipie...@gmail.com> escreveu:
>
>> wow. Alpine is pretty good. I will give it a try.
>>
>>
>> On Monday, 24 February 2020 08:33:28 UTC-8, Ramos wrote:
>>>
>>> vuejs is awesome but for simple stuff maybe alpine js is simpler.
>>> Just asking your thoughts if any...
>>> https://github.com/alpinejs/alpine  
>>>
>> -- 
>> 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/3d1f9908-3313-4c80-a8d7-142b4dfbef93%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/3d1f9908-3313-4c80-a8d7-142b4dfbef93%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/a1477e76-b8a8-4603-8d61-dc1b29d32b37%40googlegroups.com.


[web2py] Re: prettydate in py4web

2020-02-27 Thread Massimo Di Pierro
Ho, there is no pretty date. But there is no need because this is better:

https://pypi.org/project/humanize/



On Thursday, 27 February 2020 13:26:23 UTC-8, Maurice Waka wrote:
>
> what changed in py4web with this:
>
> [[=prettydate(reply.modified_on)]]
>
>
>
> which is in web2py?
>
>
> Regards
>

-- 
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/ed79259d-ce8c-404d-848e-bfd9078d2de4%40googlegroups.com.


[web2py] Re: LOAD in py4web

2020-02-27 Thread Massimo Di Pierro
never heard of unpolly.js and cannot find it. Have a link?


On Wednesday, 26 February 2020 19:32:20 UTC-8, Carlos Costa wrote:
>
> LOAD is a very cool thing! And beginners just say WOW when they can create 
> ajax-like experience so easy.
> But, IMO, it lacks some important features for modern apps, like error 
> handling and history handling.
>
> I have written some simple functions to help cover these things...
>
> Another way I found very useful was to use unpolly.js. It's magic but 
> makes me a little lazyer about getting things done with vue.js.
> (BTW they created unpolly to avoid using things like vue, react, etc, 
> really!)
>
> I would like very much to use vue.js but I am still noob regarding how to 
> use it with py4web.
> Maybe we should really encourage vue.js and stuff alike... but an initial 
> pattern would be cool.
> And IMO it should be simple and very cleared stated in the docs.
> So no one will miss LOAD.
>
> Em domingo, 23 de fevereiro de 2020 15:18:51 UTC-3, RHC escreveu:
>>
>> HI,
>>
>> I am beginning to experiment with py4web, I like the sound of it and I am 
>> looking to convert a web2py project to py4web to see how they compare.
>>
>> It appears that the LOAD (helper?) that was available in web2py templates 
>> is not available in py4web. I was using this to populate part of a web 
>> page, I liked the way you had the option to use LOAD to call a separate URL 
>> (within the same app) and insert the result into your page before returning 
>> the page to the client.
>>
>> What is the reason for the absence of LOAD in py4web? is there a 
>> recommended alternative method of achieving the same effect? I have used a 
>> mixture of ajax=True and ajax=False options for this feature.
>>
>> Thanks,
>>
>> Richard.
>>
>

-- 
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/22d8b9cf-9ce2-464b-809e-32d4dd84fd02%40googlegroups.com.


[web2py] Re: off topic - Alpine JS as an alternative to vuejs/react

2020-02-27 Thread Massimo Di Pierro
wow. Alpine is pretty good. I will give it a try.


On Monday, 24 February 2020 08:33:28 UTC-8, Ramos wrote:
>
> vuejs is awesome but for simple stuff maybe alpine js is simpler.
> Just asking your thoughts if any...
> https://github.com/alpinejs/alpine  
>

-- 
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/3d1f9908-3313-4c80-a8d7-142b4dfbef93%40googlegroups.com.


[web2py] Re: PY4WEB request.vars error

2020-02-27 Thread Massimo Di Pierro
Or request.json() to for content-type: application/json. That's what I use 
the most in POST

On Monday, 24 February 2020 07:52:46 UTC-8, Ruslan Gareev wrote:
>
> Hi!
>
> Now in py4web it will be (if POST vars): 
> request.forms.message or request.POST.message
>
> or if GET vars:
> request.query.message or request.GET.message
>
>
> понедельник, 24 февраля 2020 г., 20:11:02 UTC+5 пользователь Maurice Waka 
> написал:
>>
>> Hi 
>> I can't make a head or tail out of this.
>> What changed from e.g. 'request.vars.messag'?
>> DO you have any example I can use?
>> Regards
>>
>> On Monday, February 24, 2020 at 2:17:22 AM UTC+3, Val K wrote:
>>>
>>> p4web `request` is bottle request, see 
>>> https://bottlepy.org/docs/dev/api.html#bottle.Request 
>>>
>>> On Monday, February 24, 2020 at 12:30:29 AM UTC+3, Maurice Waka wrote:

 New issue with py4web.

 Whats the new code for request.vars??

 I get this error:


 Traceback (most recent call last):
  File "/home/maurice/.local/lib/python3.6/site-packages/bottle.py", 
 line 1397, in __getattr__
  var = self.environ['bottle.request.ext.%s'%name]
 KeyError: 'bottle.request.ext.vars'

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
  File "/home/maurice/py4web/py4web/core.py", line 551, in wrapper
  ret = func(*func_args, **func_kwargs)
  File "/home/maurice/py4web/py4web/core.py", line 512, in wrapper
  ret = func(*args, **kwargs)
  File "apps/_scaffolds/controllers.py", line 86, in index
  if request.vars:
  File "/home/maurice/.local/lib/python3.6/site-packages/bottle.py", 
 line 1400, in __getattr__
  raise AttributeError('Attribute %r not defined.' % name)
 AttributeError: Attribute 'vars' not defined.




-- 
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/12815251-490e-4300-8cf1-3a2486a5921b%40googlegroups.com.


[web2py] Re: Py4web: ¿Practical example step by step?

2020-02-27 Thread Massimo Di Pierro
Kind of. In py4web there is a new app called myfeed. I have git commits 
that show how to build it step by step. About to make a video from it.


On Monday, 24 February 2020 04:39:39 UTC-8, Yuver Parra wrote:
>
> Good morning Massimo.
> Does the promised step-by-step manual already exist?
>
> El miércoles, 22 de enero de 2020, 1:25:05 (UTC-5), Massimo Di Pierro 
> escribió:
>>
>> I am preparing one. It will be done in 2 weeks. Promise.
>>
>> On Tuesday, 21 January 2020 01:15:27 UTC-8, Dave S wrote:
>>>
>>>
>>>
>>> On Monday, January 20, 2020 at 4:55:33 AM UTC-8, Yuver Parra wrote:
>>>>
>>>>
>>>> Good morning and thanks in advance for sharing your knowledge in this 
>>>> group.
>>>> Do any of you have a practical example where you can follow step by 
>>>> step learning from the installation of py4web to the setting up of a site?
>>>>
>>>> Thanks for the reply.
>>>>
>>>
>>> When posting a new euqestion, please don't check "show at the top" --- 
>>> save that for messages that need to be displayed long-term,
>>> like etiquette or policy.
>>>
>>> Have you looked at README.md at
>>> https://github.com/web2py/py4web> ?
>>>
>>> This should make a small stand-alone server and one or more sample 
>>> applications.
>>>
>>> If you have looked at that introduction, what questions do you still 
>>> have?
>>>
>>> Also, look at the py4web documentation at
>>> 
>>>
>>> I haven't heard of any training videos yet (the older framework, web2py, 
>>> has several, but those wouldn't be useful for py4web).
>>>
>>> If you need to learn more about setting up a front-end server, such as 
>>> NginX, you should consult the NginX website.  
>>> (the web2py position on Apache is that if you don't have it already, you 
>>> should consider NginX or other easier-to-use front ends.)
>>>
>>> Good luck!
>>>
>>> /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/8700dc68-10d6-477f-93fe-46817016fc56%40googlegroups.com.


[web2py] Re: LOAD in py4web

2020-02-23 Thread Massimo Di Pierro
We can add it in utils. But before we do. Do other peopl find it useful? Is 
that a pattern we should encourage vs, for example, vue.js?

On Sunday, 23 February 2020 10:18:51 UTC-8, RHC wrote:
>
> HI,
>
> I am beginning to experiment with py4web, I like the sound of it and I am 
> looking to convert a web2py project to py4web to see how they compare.
>
> It appears that the LOAD (helper?) that was available in web2py templates 
> is not available in py4web. I was using this to populate part of a web 
> page, I liked the way you had the option to use LOAD to call a separate URL 
> (within the same app) and insert the result into your page before returning 
> the page to the client.
>
> What is the reason for the absence of LOAD in py4web? is there a 
> recommended alternative method of achieving the same effect? I have used a 
> mixture of ajax=True and ajax=False options for this feature.
>
> Thanks,
>
> Richard.
>

-- 
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/7cfaf6be-8be3-41dc-8745-ab59716f68af%40googlegroups.com.


[web2py] Re: web2py upgrade from 2.16.1

2020-02-23 Thread Massimo Di Pierro
If you upgrade web2py to the latest and you continue to use python 2.7 
everything should work as expected. We do continue to promise python 2.7 
backward compatibility (and this is all that we promised).

If you chose to upgrade to python 3.7 than your app will probably no longer 
work. You will have to convert them from python 2.7 to 3.7. This is not 
web2py specific. We do not require that you do that. Yet the Python 
language developer have made the choice of no longer supporting python 2.7 
and therefore you should upgrade.

All we offer is, 1) if you port your apps, web2py will still work with 
them. 2) we offer py4web as a framework build specifically for python 3.7 
which supports a lot of the same APIs and is faster.

On Sunday, 23 February 2020 11:28:45 UTC-8, Andrea Fae' wrote:
>
> I 'm using web2py 2.16.1 stable on my computer and I used it with python 
> version 2.7.
> I programmed some sites with this RAD system.
> So I want to upgrade to the latest 2.18.5 stable and Python 3. What can I 
> do to do it?
> What could be the implications on my projects made with 2.16 ant python 2?
>
> If all works it's possible to change in the production environment on 
> pyrhonanywhere the same? How?
> Thank you
>

-- 
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/c36102f9-b562-4a40-a4c2-5dacd83e9a44%40googlegroups.com.


[web2py] Re: unexpected end of stream - py4web

2020-02-22 Thread Massimo Di Pierro
Can you show us some minimum code to rproduce?

On Friday, 21 February 2020 20:38:08 UTC-8, Edoardo Torrini wrote:
>
> Hi 
>
> I create a project client/server compose by an application mobile (client) 
> and a webservice (py4web).
> the application create request to the webservice and the server reply.
> I add a request scheduling using the celery and redis.
> I follow pass for pass the guide on the official py4web site.
>
> the problem is that when I generete the get request from the app create an 
> exception: "unexpected end of stream"
> Someone know how to fix this issue?
>
> Thanks
> Edoardo Torrini
>

-- 
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/1483d926-2e83-440b-ba2f-21aa2c5c6840%40googlegroups.com.


[web2py] Re: pydal bug!

2020-02-20 Thread Massimo Di Pierro
do

auth.inject = False

On second thought. This should be default because can be an information 
leak issue.

On Thursday, 20 February 2020 07:47:00 UTC-8, Ramos wrote:
>
> this is the result 
> [image: image.png]
> of this code . Why do i get user ???
> @action('colors')
> @action.uses( session, db, T, auth.user)
> def colors():
>
> return {'colors': ['red', 'blue', 'green']}
>

-- 
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/93375b2d-b080-40b4-a72a-59b423324aa4%40googlegroups.com.


[web2py] Re: py4web and record versioning

2020-02-20 Thread Massimo Di Pierro
No obvious solution yet but will prioritize this. Would you mind opening an 
issue on github about this?

On Wednesday, 19 February 2020 12:33:32 UTC-8, Carlos Hanson wrote:
>
> It looks like table inheritance is affected by the same issue:
>
>
> monster = db.Table(db, 'monster', Field('color'), Field('size'))
> db.define_table('thing', Field('name'), monster)
>
>
> The following traceback is the same as the error using 
> _enable_record_versioning() starting at *table = self.lazy_define_table*:
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/home/chanson/py/py4web/apps/thing/__init__.py", line 7, in 
> 
> from . models import db
>   File "/home/chanson/py/py4web/apps/thing/models.py", line 9, in 
> db.define_table('thing', Field('name'), monster)
> *  File 
> "/home/chanson/.local/share/virtualenvs/py4web-recc_4-8/lib/python3.6/site-packages/pydal/base.py",
>  
> line 656, in define_table*
> *table = self.lazy_define_table(tablename, *fields, **kwargs)*
> *  File 
> "/home/chanson/.local/share/virtualenvs/py4web-recc_4-8/lib/python3.6/site-packages/pydal/base.py",
>  
> line 676, in lazy_define_table*
> *if field.requires is DEFAULT:*
> *  File 
> "/home/chanson/.local/share/virtualenvs/py4web-recc_4-8/lib/python3.6/site-packages/threadsafevariable/__init__.py",
>  
> line 16, in __get__*
> *return getattr(self.storage, "%s.%s" % (id(instance), id(self)))*
> *  File "src/gevent/local.py", line 408, in 
> gevent._local.local.__getattribute__*
> AttributeError: 'gevent._local.local' object has no attribute 
> '139976984026752.139976984930736'
>
>
>
> On Tuesday, February 18, 2020 at 8:07:25 PM UTC-8, Carlos Hanson wrote:
>>
>> Greetings,
>>
>> I just started using py4web, and I'm very excited to do so. 
>>
>> Has there been any more thought on this issue? I was partially into a new 
>> web2py app in which I use _enable_record_versioning(), and I am migrating 
>> it to py4web.
>>
>> Thanks.
>>
>>
>> On Saturday, August 17, 2019 at 10:34:21 PM UTC-7, Massimo Di Pierro 
>> wrote:
>>>
>>> Sorry for the late response. I just run into this myself. Do not have a 
>>> good solution at this time, unless we make pydal aware of 
>>> ThreadSafeVariable(s). Maybe we have to.
>>>
>>> On Wednesday, 31 July 2019 05:05:50 UTC-7, Manuel Vio wrote:
>>>>
>>>> Ok, I narrowed the problem a bit:
>>>>
>>>> In py4web/core.py, around line 207, there is this adjustment in order 
>>>> to make some variables threadsafe:
>>>>
>>>> # make sure some variables in pydal are thread safe
>>>> for _ in ['readable', 'writable', 'default', 'update', 'requires']:
>>>> setattr(pydal.DAL.Field, _, threadsafevariable.ThreadSafeVariable())
>>>>
>>>> Turns out that PyDAL's _enable_record_versioning(), in order to create 
>>>> the archive table, clones all original fields with their properties. Or, 
>>>> at 
>>>> least, it tries to: it seems that copy() fails to correctly transfer 
>>>> threadsafevariable informations when dealing with those variables.
>>>> I guess that when cloned field's requires attribute is accessed those 
>>>> information are not valid anymore and py4web throws the aforementioned 
>>>> exception.
>>>> I was able to circumvent this error adding an explicit copy of the 
>>>> attribute in pydal, but still I'm not sure if this could eventually lead 
>>>> to 
>>>> thread problems:
>>>>
>>>> for field in self:
>>>> nfk = same_db or not field.type.startswith('reference')
>>>> clone = field.clone(unique=False, type=field.type if nfk else 'bigint')
>>>> clone.requires = copy.copy(field.requires)
>>>> clones.append(
>>>> clone
>>>> )
>>>>
>>>>
>>>> Any thougths?
>>>>
>>>

-- 
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/0e39aaa8-753d-41b9-965e-a04c19ec14ac%40googlegroups.com.


[web2py] Re: buefy for bulma /py4web

2020-02-20 Thread Massimo Di Pierro
I only picked bulma because it is truly js agnostic. 

On Tuesday, 18 February 2020 10:03:46 UTC-8, Ramos wrote:
>
> py4web has bulma out of the box
> so i guess buefy is more advisable than vuetify to use with py4web right ?
>
> https://buefy.org/  
>

-- 
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/2e57d257-0478-48cf-8be2-56e704b072aa%40googlegroups.com.


[web2py] Re: ERROR on Request

2020-02-20 Thread Massimo Di Pierro
in py4web request is the bottlepy request. 
https://bottlepy.org/docs/dev/api.html#the-request-object
There is no now.

You can use datetime.timetime.now()

On Tuesday, 18 February 2020 08:34:51 UTC-8, Maurice Waka wrote:
>
> BUT 
> Now I get this:
>
> Field('modified_on', 'datetime', default=request.now, update=request.now),
>   File "/usr/local/lib/python3.6/dist-packages/bottle.py", line 1400, in 
> __getattr__
> raise AttributeError('Attribute %r not defined.' % name)
> AttributeError: Attribute 'now' not defined.
>
>
> On Tuesday, February 18, 2020 at 7:13:27 PM UTC+3, Maurice Waka wrote:
>>
>> Thanks @Lovdie
>>
>> got 
>>
>>
>> from py4web import request,
>>
>> On Tuesday, February 18, 2020 at 6:58:10 PM UTC+3, Maurice Waka wrote:
>>>
>>> In py4web, I cant use this syntax:
>>> default = request.now
>>>
>>>
>>> Error:
>>>
>>> Field('modified_on', 'datetime', default=request.now),# 
>>> update=request.now),
>>> NameError: name 'request' is not defined
>>>
>>>

-- 
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/ebc49b2d-ed20-4fd9-9aa0-ee94a7f4cfde%40googlegroups.com.


[web2py] Re: Future of web2py

2020-02-20 Thread Massimo Di Pierro
It will continue fix bugs. I will add new features as long the same 
features overlap with py4web.
Honestly web2py has not needed much attention in a while.
I do recommend that people move their apps to py4web simply because I 
believe the latter is better.

On Tuesday, 18 February 2020 07:36:24 UTC-8, Clemens wrote:

> Hello Massimo,
>
> I've understood, that py4web is the future. But I have one important 
> question: Will web2py further maintained? And how long will it be 
> maintained? I'm asking, because I've developed an application on web2py and 
> I need to plan when it has to be migrated/re-implemented. And what do you 
> think will be a factor (e.g. in percentage of the original implementation 
> effort) to switch an application from web2py to py4web?
>
> Thanks in advance for a short answer!
>
> Best regards
> Clemens
>

-- 
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/155aa8d4-7785-4a38-a529-624cb2b36b47%40googlegroups.com.


[web2py] Re: MySQL server has gone away - py4web

2020-02-20 Thread Massimo Di Pierro
Can you check which version of pydal you are using?
Need to decide whether to make this the default behavior

On Tuesday, 18 February 2020 03:35:47 UTC-8, Marcello wrote:
>
> Hi Massimo,
>
> Great !
> Now worked fine...
>
> Thanks
>
>
> On Tuesday, February 18, 2020 at 12:22:04 AM UTC-3, Massimo Di Pierro 
> wrote:
>>
>> sorry. My bad. try:
>>
>> +self._adapter.reconnect()  
>>
>> On Sunday, 16 February 2020 19:17:25 UTC-8, Marcello wrote:
>>>
>>> I got this error:
>>>
>>>   File "/home/parra/py4web/py4web/core.py", line 239, in on_request
>>> db._adapter.reconnect()
>>> NameError: name 'db' is not defined
>>>
>>>
>>>
>>>
>>> On Sunday, February 16, 2020 at 10:22:48 PM UTC-3, Massimo Di Pierro 
>>> wrote:
>>>>
>>>> The db fixture should automatiically try reconnect.
>>>>
>>>> To help me debug can you edit py4web/core.py and add the line below:
>>>>
>>>>  class DAL(pydal.DAL, Fixture):
>>>>  def on_request(self):
>>>>  threadsafevariable.ThreadSafeVariable.restore(ICECUBE)
>>>> + db._adapter.reconnect()  
>>>>
>>>> Does it solve the problem?
>>>>
>>>>
>>>> On Saturday, 15 February 2020 04:15:38 UTC-8, Marcello wrote:
>>>>>
>>>>> I'm with lastest version...
>>>>>
>>>>> Shouldn't reconnect to db every page load ???
>>>>> If the server stays 1 hour without serving pages, a reconnection is 
>>>>> needed... or not ?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Saturday, February 15, 2020 at 8:30:58 AM UTC-3, Massimo Di Pierro 
>>>>> wrote:
>>>>>>
>>>>>> My guess is that there is some timeout in the mysql config example.
>>>>>> Can you repro with latest py4web?
>>>>>>
>>>>>> On Friday, 14 February 2020 14:31:58 UTC-8, Marcello wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Any informatiion about this ?
>>>>>>> Nobody using py4web with mysql ??
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Tuesday, February 11, 2020 at 6:58:11 PM UTC-3, Marcello wrote:
>>>>>>>>
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> I'm trying py4web and found something stragne.
>>>>>>>> Don't know if I'm making something wrong.
>>>>>>>>
>>>>>>>> I'm having "MySQL server has gone away" error if I wait some time 
>>>>>>>> (about 10 minutes) betweeen page reloads...
>>>>>>>>
>>>>>>>> I tested same thing with web2py and this problem did not happen...
>>>>>>>>
>>>>>>>> Is it a bug or a problem here ?
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Marcello
>>>>>>>>
>>>>>>>

-- 
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/0039ff48-b72b-48b3-a36b-9866d0e4666d%40googlegroups.com.


Re: [web2py] Web2py sessions in scheduler

2020-02-17 Thread Massimo Di Pierro
Try

   session._forget = True

Yet this should not be happening so hard to suggest a fix without seeing 
the code.

On Monday, 17 February 2020 17:44:32 UTC-8, Frédéric Samson wrote:
>
> I tried this in the model file :
>
> if request.is_scheduler:
> session.forget(response)
>
> and 
>
> if request.is_scheduler:
> session.forget()
>
> but it still store sessions in the database.
>
>
> Le lundi 17 février 2020 09:54:43 UTC-5, Massimiliano a écrit :
>>
>> Have you tried if
>>
>> *session.forget(response)* or *session.forget() *can help you?
>>
>>
>> http://web2py.com/books/default/chapter/29/04/the-core?search=session.forget#session
>>
>>
>> On Mon, Feb 17, 2020 at 12:33 PM Frédéric Samson  
>> wrote:
>>
>>> Every scheduler task that is running stores a session in my database. Is 
>>> there a way to not to store the session when request.is_scheduler is true?
>>>
>>> -- 
>>> 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 web...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/55773be3-9155-465d-a90a-70eb25df520c%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>> Massimiliano
>>
>

-- 
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/baf0204e-2ff1-47b6-9c1a-e620ebe073a9%40googlegroups.com.


[web2py] Re: py4web translations

2020-02-17 Thread Massimo Di Pierro
You have to pass T to the view

@action('index')
@action.uses('index.html', T)
def index():
 return dict(message="hello world", T=T)
# in view  [[=T(message)]]

or 

@unauthenticated
def index():
 return dict(message="hello world")

and it is all automatic. Need the latest common.py from scaffold.


On Monday, 17 February 2020 19:08:05 UTC-8, clara wrote:
>
> Hi,
>
> I just tried using translations in a template in py4web: [[ =T('some 
> text') ]]
>
> but it doesn't work. I tried importing T in the template but then I got:
>
> "No module named 'yatl.common'"
>
> Probably I am overlooking something...
>
> Any help will be appreciated! 
>
> Thanks,
>
> Clara
>
>

-- 
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/158199db-53ce-4e75-becc-ac15b6794db6%40googlegroups.com.


[web2py] Re: PY4WEB socketIO

2020-02-17 Thread Massimo Di Pierro
It would be trivial to implement it like flask does. 

You can do it right now using the bottlepy way:
https://pypi.org/project/bottle-websocket/
or
https://github.com/marlboromoo/bottle-socketio-example
py4web uses bottle under the hood.

The problem is that I would like something better than that.
I am not convinced it would work well in a cloud setting o when you have 
servers behind a load balancer.

Imagine you have two chat clients connected to two servers. If your client 
posts a chat message, how does one server notify the other server to notify 
the other client? This is the hard problem to solve. I am not interests in 
toy examples. py4web will have this.

Massimo


On Monday, 17 February 2020 10:31:39 UTC-8, Ramos wrote:
>
> hello , just asking if py4web will have the ability like flask to have a 
> socket  as simple as ...
> Regards
>
> @socketio.on('my event')def handle_my_custom_event(arg1, arg2, arg3):
> print('received args: ' + arg1 + arg2 + arg3)
>
>

-- 
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/dc01a0c6-dd54-4cab-a3c6-6073f95cd19d%40googlegroups.com.


[web2py] Re: MySQL server has gone away - py4web

2020-02-17 Thread Massimo Di Pierro
sorry. My bad. try:

+self._adapter.reconnect()  

On Sunday, 16 February 2020 19:17:25 UTC-8, Marcello wrote:
>
> I got this error:
>
>   File "/home/parra/py4web/py4web/core.py", line 239, in on_request
> db._adapter.reconnect()
> NameError: name 'db' is not defined
>
>
>
>
> On Sunday, February 16, 2020 at 10:22:48 PM UTC-3, Massimo Di Pierro wrote:
>>
>> The db fixture should automatiically try reconnect.
>>
>> To help me debug can you edit py4web/core.py and add the line below:
>>
>>  class DAL(pydal.DAL, Fixture):
>>  def on_request(self):
>>  threadsafevariable.ThreadSafeVariable.restore(ICECUBE)
>> + db._adapter.reconnect()  
>>
>> Does it solve the problem?
>>
>>
>> On Saturday, 15 February 2020 04:15:38 UTC-8, Marcello wrote:
>>>
>>> I'm with lastest version...
>>>
>>> Shouldn't reconnect to db every page load ???
>>> If the server stays 1 hour without serving pages, a reconnection is 
>>> needed... or not ?
>>>
>>>
>>>
>>>
>>> On Saturday, February 15, 2020 at 8:30:58 AM UTC-3, Massimo Di Pierro 
>>> wrote:
>>>>
>>>> My guess is that there is some timeout in the mysql config example.
>>>> Can you repro with latest py4web?
>>>>
>>>> On Friday, 14 February 2020 14:31:58 UTC-8, Marcello wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> Any informatiion about this ?
>>>>> Nobody using py4web with mysql ??
>>>>>
>>>>>
>>>>>
>>>>> On Tuesday, February 11, 2020 at 6:58:11 PM UTC-3, Marcello wrote:
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I'm trying py4web and found something stragne.
>>>>>> Don't know if I'm making something wrong.
>>>>>>
>>>>>> I'm having "MySQL server has gone away" error if I wait some time 
>>>>>> (about 10 minutes) betweeen page reloads...
>>>>>>
>>>>>> I tested same thing with web2py and this problem did not happen...
>>>>>>
>>>>>> Is it a bug or a problem here ?
>>>>>>
>>>>>>
>>>>>> Thanks
>>>>>> Marcello
>>>>>>
>>>>>

-- 
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/765e49a2-b819-4d1c-8356-a7827d4b8f96%40googlegroups.com.


[web2py] Re: validator formatter when validation fails

2020-02-17 Thread Massimo Di Pierro
I think this is fixed now. Please give it a try.

On Monday, 17 February 2020 13:53:34 UTC-8, Eric wrote:
>
> In py4web, when form validation fails on a datetime field, py4web throws 
> and exception.
> In the IS_DATETIME validator, when validation fails, validate() returns 
> value as string (the original value).
> The form code tries to display the fields properly by calling field's 
> validator formatter().
> Since the value is string and not datetime, formatter() throws exception.
>
> I wrote issue here:https://github.com/web2py/pydal/issues/609
> but now I'm not sure whether change should be pydal or py4web.
> Should the formatter() handle value with type of string?
> Or, should form not try to call formatter() when there is an error?
>
>
>

-- 
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/2e1853c9-d739-4439-a98d-99ff9ef23a06%40googlegroups.com.


  1   2   3   4   5   6   7   8   9   10   >